From f61b35b14c3f121ca10bcfdd626f939017c82b7f Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Tue, 23 May 2023 18:33:59 +0300 Subject: [PATCH 1/7] [#9] Add table of contents --- assets/css/style.css | 28 ++++++++++++++++++++++++++++ assets/js/script.js | 12 ++++++++++++ layouts/partials/default.html | 8 ++++++++ 3 files changed, 48 insertions(+) diff --git a/assets/css/style.css b/assets/css/style.css index 4b9d929..b653dab 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -22,6 +22,10 @@ src: url(../fonts/WorkSans-SemiBold.eot?#iefix) format("embedded-opentype"), url(../fonts/WorkSans-SemiBold.woff) format("woff"), url(../fonts/WorkSans-SemiBold.ttf) format("truetype"), url(../fonts/WorkSans-SemiBold.svg) format("svg") } +html { + scroll-behavior: smooth; +} + body { line-height: 1.5; font-family: var(--font-family), sans-serif; @@ -606,6 +610,30 @@ textarea.form-control { top: 8px; } +.content ol li, +.content ol li ol { + list-style-type: disc; + margin-bottom: 0; +} + +.content h3:before, +.content h4:before, +.content h5:before { + display: block; + content: ""; + height: 75px; + margin: -75px 0 0; +} + +.content .title-link { + opacity: 0; + transition: 0.7s; +} + +.content .title-link.active { + opacity: 1; +} + .list-styled li { position: relative; } diff --git a/assets/js/script.js b/assets/js/script.js index 4b46685..d377d56 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -128,6 +128,18 @@ }) + // table of contents + $('h3, h4, h5', '.content').each(function () { + $(this).append(' #'); + + $(this).hover(function(){ + $(this).find('a').addClass('active'); + }, function(){ + $(this).find('a').removeClass('active'); + }); + }); + + // Download page to pdf format window.onload = function() { var generatePDF = document.getElementById('generatePDF'); diff --git a/layouts/partials/default.html b/layouts/partials/default.html index a69fccd..f105c75 100644 --- a/layouts/partials/default.html +++ b/layouts/partials/default.html @@ -50,6 +50,14 @@ + {{ if .Params.toc }} +
+ Table of Contents + +
+ {{ end }} {{ end }} {{.Content}} -- 2.45.3 From ef08ba9d6d918912e64b43d9a533dfe0895d0703 Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Fri, 26 May 2023 20:07:13 +0300 Subject: [PATCH 2/7] [#9] Update FEP links styles --- assets/css/style.css | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index b653dab..4fbacd7 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -616,6 +616,11 @@ textarea.form-control { margin-bottom: 0; } +.content ol li a:hover, +.content ol li ol a:hover { + text-decoration: underline; +} + .content h3:before, .content h4:before, .content h5:before { @@ -627,10 +632,13 @@ textarea.form-control { .content .title-link { opacity: 0; - transition: 0.7s; + transition: 0.3s; + margin-left: 10px; } -.content .title-link.active { +.content h3:hover .title-link, +.content h4:hover .title-link, +.content h5:hover .title-link { opacity: 1; } -- 2.45.3 From 9e2a1518cf823d2542d62442f61f33346b214311 Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Fri, 26 May 2023 20:16:25 +0300 Subject: [PATCH 3/7] [#9] Update table of contents function --- assets/js/script.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index d377d56..b642fdf 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -130,13 +130,7 @@ // table of contents $('h3, h4, h5', '.content').each(function () { - $(this).append(' #'); - - $(this).hover(function(){ - $(this).find('a').addClass('active'); - }, function(){ - $(this).find('a').removeClass('active'); - }); + $(this).append('#'); }); -- 2.45.3 From 2ec9c01391955bb535283d15d5e4a67441f11b42 Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Mon, 29 May 2023 11:20:57 +0300 Subject: [PATCH 4/7] [#9] Update table of contents styles --- assets/css/style.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 4fbacd7..d1ef98e 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -610,17 +610,17 @@ textarea.form-control { top: 8px; } -.content ol li, -.content ol li ol { - list-style-type: disc; +#TableOfContents ul li, +#TableOfContents ul li ul { margin-bottom: 0; } -.content ol li a:hover, -.content ol li ol a:hover { +#TableOfContents ul li a:hover, +#TableOfContents ul li ul a:hover { text-decoration: underline; } +/* this is so that the header does not overlap the section title */ .content h3:before, .content h4:before, .content h5:before { -- 2.45.3 From 53e601ad4b68b928984dc024e7149aa16c69b21b Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Mon, 29 May 2023 11:30:53 +0300 Subject: [PATCH 5/7] [#9] Update headers levels --- assets/css/style.css | 24 ++++++++++++++++++++---- assets/js/script.js | 2 +- layouts/partials/default.html | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index d1ef98e..903bddd 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -82,6 +82,22 @@ h6, font-size: 14px; } +#title { + font-size: 32px; +} + +.content h2 { + font-size: 26px; +} + +.content h3 { + font-size: 20px; +} + +.content h4 { + font-size: 18px; +} + /* Button style */ .btn { font-size: 14px; @@ -621,9 +637,9 @@ textarea.form-control { } /* this is so that the header does not overlap the section title */ +.content h2:before, .content h3:before, -.content h4:before, -.content h5:before { +.content h4:before { display: block; content: ""; height: 75px; @@ -636,9 +652,9 @@ textarea.form-control { margin-left: 10px; } +.content h2:hover .title-link, .content h3:hover .title-link, -.content h4:hover .title-link, -.content h5:hover .title-link { +.content h4:hover .title-link { opacity: 1; } diff --git a/assets/js/script.js b/assets/js/script.js index b642fdf..79e87f2 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -129,7 +129,7 @@ // table of contents - $('h3, h4, h5', '.content').each(function () { + $('h2, h3, h4', '.content').each(function () { $(this).append('#'); }); diff --git a/layouts/partials/default.html b/layouts/partials/default.html index f105c75..96b665b 100644 --- a/layouts/partials/default.html +++ b/layouts/partials/default.html @@ -30,7 +30,7 @@
-

{{ partial "title.html" . }}

+

{{ partial "title.html" . }}

{{ if .Content }}
{{ if isset .Params "status" }} -- 2.45.3 From 2edd4fed28af2dd78401ffece88a45158145b755 Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Mon, 29 May 2023 17:17:47 +0300 Subject: [PATCH 6/7] [#9] Update headers styles --- assets/css/style.css | 35 ++++++++++++++--------------------- layouts/index.html | 2 +- layouts/partials/banner.html | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 903bddd..029ae5b 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -54,27 +54,27 @@ h6 { h1, .h1 { - font-size: 45px; + font-size: 32px; } h2, .h2 { - font-size: 32px; + font-size: 26px; } h3, .h3 { - font-size: 26px; + font-size: 20px; } h4, .h4 { - font-size: 20px; + font-size: 18px; } h5, .h5 { - font-size: 18px; + font-size: 16px; } h6, @@ -82,22 +82,6 @@ h6, font-size: 14px; } -#title { - font-size: 32px; -} - -.content h2 { - font-size: 26px; -} - -.content h3 { - font-size: 20px; -} - -.content h4 { - font-size: 18px; -} - /* Button style */ .btn { font-size: 14px; @@ -246,8 +230,17 @@ select:focus { } } +.main-title { + font-size: 45px; +} + .section-title { margin-bottom: 40px; + font-size: 32px; +} + +.section-item { + font-size: 26px; } .bg-cover { diff --git a/layouts/index.html b/layouts/index.html index 133d2aa..32602b3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -22,7 +22,7 @@ {{ with .Params.icon}} {{end}} -

{{ .Title }}

+

{{ .Title }}

{{with .Params.description}}

{{. | markdownify}}

{{end}} diff --git a/layouts/partials/banner.html b/layouts/partials/banner.html index 1936158..8635074 100644 --- a/layouts/partials/banner.html +++ b/layouts/partials/banner.html @@ -2,7 +2,7 @@
-

+

{{ .Site.Params.banner.title | markdownify }}

-- 2.45.3 From bf09c1036212b58f5cc8c69d65af7e7e87d77cee Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Mon, 29 May 2023 17:18:27 +0300 Subject: [PATCH 7/7] [#9] Update table of contents function --- assets/js/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/script.js b/assets/js/script.js index 79e87f2..7316daf 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -130,7 +130,9 @@ // table of contents $('h2, h3, h4', '.content').each(function () { - $(this).append('#'); + if ($('#TableOfContents', '.content').length) { + $(this).append('#'); + } }); -- 2.45.3