From 4be7a409fbfb8b439ccbdd9f79ea836cd6ebb956 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:48:39 +1000 Subject: [PATCH 1/8] Implemented basic sections --- content/overview-math.fr.md | 1 + content/overview-math.md | 1 + templates/page.html | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/content/overview-math.fr.md b/content/overview-math.fr.md index 4729e5ad..e24b4e63 100644 --- a/content/overview-math.fr.md +++ b/content/overview-math.fr.md @@ -12,6 +12,7 @@ toc = true math = true math_auto_render = true keywords = "Math, Matematics, Notation, KaTeX, Mathematical Notation" +section = "Features" +++ Vous pouvez utiliser [KaTeX](https://katex.org) pour rendre des notations mathématiques. diff --git a/content/overview-math.md b/content/overview-math.md index 0a9931de..c34d2f26 100644 --- a/content/overview-math.md +++ b/content/overview-math.md @@ -12,6 +12,7 @@ toc = true math = true math_auto_render = true keywords = "Math, Matematics, Notation, KaTeX, Mathematical Notation" +section = "Features" +++ You can use [KaTeX](https://katex.org) to render mathematical notations. diff --git a/templates/page.html b/templates/page.html index 6ca83d46..9e15c0d3 100644 --- a/templates/page.html +++ b/templates/page.html @@ -45,6 +45,26 @@ {{- macros::meta_post(page=page, config=config) }} {%- endif %}{%- endif %} + {%- if page.extra.section %} + {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %} + + +
+

{{ tag.name }} Series

+
    + {%- for inner in tag.pages | sort(attribute="year") %} + {%- if inner.content == page.content %} +
  1. {{ inner.title }}
  2. + {% else %} +
  3. {{ inner.title }}
  4. + {%- endif %} + {%- endfor %} +
+
+ + + {%- endif %} + {{ page.content | safe }} {%- if config.extra.meta_post.position %} From 785a8ab5caada5d1a1d6b96c0a1e86484eeea646 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Thu, 14 Sep 2023 17:42:13 +1000 Subject: [PATCH 2/8] Added custom css --- sass/abridge.scss | 12 ++++++++++++ templates/page.html | 11 ++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/sass/abridge.scss b/sass/abridge.scss index 7208721c..430640e7 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -217,6 +217,7 @@ $imgswap: true !default;//Image Swap on hover/click $misc: false !default; $grid: false !default;//Infinity Grid, column based layouts. $syntax: true !default;//syntax highlighting for code blocks +$series: true !default;//series of posts /****************************************************************************** * Root element @@ -1554,3 +1555,14 @@ $syntax: true !default;//syntax highlighting for code blocks // color: var(--h1); //} } + +@if $series { + .series { + max-width: 30rem; + min-width: 14rem; + padding: 0.25rem 2rem; + margin: var(--s1) auto; + border-radius: var(--br); + background-color: var(--c2); + } +} \ No newline at end of file diff --git a/templates/page.html b/templates/page.html index 9e15c0d3..470baa3d 100644 --- a/templates/page.html +++ b/templates/page.html @@ -45,12 +45,13 @@ {{- macros::meta_post(page=page, config=config) }} {%- endif %}{%- endif %} + {%- block series %} + {%- if page.extra.section %} {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %} - -
-

{{ tag.name }} Series

+
+

{{ tag.name }} ({{ tag.page_count }} Part Series)

    {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -61,10 +62,10 @@

    {{ tag.name }} Series

    {%- endfor %}
- - {%- endif %} + {%- endblock series %} + {{ page.content | safe }} {%- if config.extra.meta_post.position %} From a817551e36f1dbcd4ba0e5d3385e4a5e94cf8156 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:50:15 +1000 Subject: [PATCH 3/8] Custom css: add to toc side panel --- sass/abridge.scss | 48 +++++++++++++++++++++++++++++++++++++++------ templates/page.html | 23 ++++++++++++++++++---- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/sass/abridge.scss b/sass/abridge.scss index 430640e7..073541e1 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1556,13 +1556,49 @@ $series: true !default;//series of posts //} } -@if $series { - .series { - max-width: 30rem; - min-width: 14rem; - padding: 0.25rem 2rem; - margin: var(--s1) auto; +.series-mobile { + max-width: 30rem; + min-width: 14rem; + padding: 0.15rem 1.25rem; + margin: var(--s1) auto; + border-radius: var(--br); + background-color: var(--c2); +} + + +@if $series and $toc { + + .series-toc { border-radius: var(--br); + border-top: 5px solid var(--a1); background-color: var(--c2); + position: block; + top: var(--s2); + margin-top: var(--s2); + padding: 0 var(--s2) var(--s2); + max-height: 100vh; + overflow: auto; + } + + .series-toc li { + font-size: .875rem; + } + + .series-toc li a { + color: var(--f1); + } + + + .series-toc li a.on:hover { + color: var(--a1); + } + + @if map-get($breakpoints, "md") { + // mobile first is min-width for desktop instead of max-width for mobile + @media (min-width: map-get($breakpoints, "md")) { + .series-mobile { + display: none; + } + } } } \ No newline at end of file diff --git a/templates/page.html b/templates/page.html index 470baa3d..8b2f43b2 100644 --- a/templates/page.html +++ b/templates/page.html @@ -45,13 +45,12 @@ {{- macros::meta_post(page=page, config=config) }} {%- endif %}{%- endif %} - {%- block series %} {%- if page.extra.section %} {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %} -
-

{{ tag.name }} ({{ tag.page_count }} Part Series)

+
+

{{ tag.name }} ({{ tag.page_count }} Part Series)

    {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -64,7 +63,6 @@

    {{ tag.name }} ({{ tag.page_count }} Part Series)

{%- endif %} - {%- endblock series %} {{ page.content | safe }} @@ -88,7 +86,24 @@

{{ tag.name }} ({{ tag.page_count }} Part Series)

{%- set toc = page.toc %} {%- endif %} {%- if toc %} +
+ {%- if page.extra.section %} + {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %} +
+

{{ tag.name }} ({{ tag.page_count }} Part Series)

+
    + {%- for inner in tag.pages | sort(attribute="year") %} + {%- if inner.content == page.content %} +
  1. {{ inner.title }}
  2. + {% else %} +
  3. {{ inner.title }}
  4. + {%- endif %} + {%- endfor %} +
+
+ {%- endif %} +
{%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %} {%- for h in toc %} From 174722e3af3b3b6596bd3bcae9d0b5ec9e8cc5ed Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:50:16 +1000 Subject: [PATCH 4/8] Add multilingual support for number of series --- config.toml | 2 ++ templates/page.html | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 52b8e187..a1498071 100644 --- a/config.toml +++ b/config.toml @@ -67,6 +67,8 @@ Tags = "Mots-clés" Contact = "Contact" Privacy = "Confidentialité" Sitemap = "Plan du site" +## Describtion of the number of parts in a series of posts +Series_parts = "Série en $NUMBER_OF_PARTS parties" ### Page not found, maybe moved or not in this language 404_not_found = "Page introuvable, peut-être déplacée ou non dans cette langue" ### Try searching or diff --git a/templates/page.html b/templates/page.html index 8b2f43b2..baf34d38 100644 --- a/templates/page.html +++ b/templates/page.html @@ -47,10 +47,20 @@ {%- if page.extra.section %} - {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %} + + {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section, lang=lang) %} + {%- set page_num = tag.page_count | as_str %} + + {%- if lang != config.default_language %} + {%- set parts_string = trans(key="Series_parts", lang=lang) | replace(from="$NUMBER_OF_PARTS", to=page_num) %} + {% else %} + {%- set parts_string = page_num ~ " part Series" %} + {% endif -%} + +
-

{{ tag.name }} ({{ tag.page_count }} Part Series)

+

{{ tag.name }} ({{ parts_string }})

    {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -89,9 +99,8 @@

    {{ tag.name }} ({{ tag.page_count }} Part Series)

    {%- if page.extra.section %} - {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section) %}
    -

    {{ tag.name }} ({{ tag.page_count }} Part Series)

    +

    {{ tag.name }} ({{ parts_string }})

      {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} From 65b6cd012be97d537d6ead7894e36026519b9f93 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:54:53 +1000 Subject: [PATCH 5/8] Fix translation and add tag link --- config.toml | 2 +- sass/abridge.scss | 20 +++++++++++++++----- templates/page.html | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/config.toml b/config.toml index a1498071..aeed1f6e 100644 --- a/config.toml +++ b/config.toml @@ -68,7 +68,7 @@ Contact = "Contact" Privacy = "Confidentialité" Sitemap = "Plan du site" ## Describtion of the number of parts in a series of posts -Series_parts = "Série en $NUMBER_OF_PARTS parties" +Series_parts = "Série de $NUMBER_OF_PARTS parties" ### Page not found, maybe moved or not in this language 404_not_found = "Page introuvable, peut-être déplacée ou non dans cette langue" ### Try searching or diff --git a/sass/abridge.scss b/sass/abridge.scss index 073541e1..a6dade01 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1572,7 +1572,7 @@ $series: true !default;//series of posts border-radius: var(--br); border-top: 5px solid var(--a1); background-color: var(--c2); - position: block; + position: static; top: var(--s2); margin-top: var(--s2); padding: 0 var(--s2) var(--s2); @@ -1584,13 +1584,23 @@ $series: true !default;//series of posts font-size: .875rem; } - .series-toc li a { + .series-toc h4 a { color: var(--f1); + font-weight: bold; + &:hover { + cursor: pointer; + color: var(--a3); + text-decoration: none; + } } - - .series-toc li a.on:hover { - color: var(--a1); + .series-toc ol a { + color: var(--f1); + &:hover { + cursor: pointer; + color: var(--a2); + text-decoration: underline; + } } @if map-get($breakpoints, "md") { diff --git a/templates/page.html b/templates/page.html index baf34d38..8999b96e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -60,7 +60,7 @@
      -

      {{ tag.name }} ({{ parts_string }})

      +

      {{ tag.name }} ({{ parts_string }})

        {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -100,7 +100,7 @@

        {{ tag.name }} ({{ parts_string }})

        {%- if page.extra.section %}
        -

        {{ tag.name }} ({{ parts_string }})

        +

        {{ tag.name }} ({{ parts_string }})

          {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} From e68c9e2b89a949f79a9c51d42ed2d2c36b1a4d9c Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:56:20 +1000 Subject: [PATCH 6/8] Remove redundant css and streamline title --- sass/abridge.scss | 8 ++++---- templates/page.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sass/abridge.scss b/sass/abridge.scss index a6dade01..70456954 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1572,14 +1572,16 @@ $series: true !default;//series of posts border-radius: var(--br); border-top: 5px solid var(--a1); background-color: var(--c2); - position: static; - top: var(--s2); margin-top: var(--s2); padding: 0 var(--s2) var(--s2); max-height: 100vh; overflow: auto; } + .series-toc ol { + margin: 0; + } + .series-toc li { font-size: .875rem; } @@ -1588,7 +1590,6 @@ $series: true !default;//series of posts color: var(--f1); font-weight: bold; &:hover { - cursor: pointer; color: var(--a3); text-decoration: none; } @@ -1597,7 +1598,6 @@ $series: true !default;//series of posts .series-toc ol a { color: var(--f1); &:hover { - cursor: pointer; color: var(--a2); text-decoration: underline; } diff --git a/templates/page.html b/templates/page.html index 8999b96e..038d0272 100644 --- a/templates/page.html +++ b/templates/page.html @@ -60,7 +60,7 @@
          -

          {{ tag.name }} ({{ parts_string }})

          + {{ tag.name }} ({{ parts_string }})
            {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -100,7 +100,7 @@

            {%- if page.extra.section %}
            -

            {{ tag.name }} ({{ parts_string }})

            + {{ parts_string }}
              {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} From c4237cf10250177a3d3b00724b360f8a62194e00 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:05:28 +1000 Subject: [PATCH 7/8] Fix root scss and consistent toc style --- COPY-TO-ROOT-SASS/abridge.scss | 1 + sass/abridge.scss | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/COPY-TO-ROOT-SASS/abridge.scss b/COPY-TO-ROOT-SASS/abridge.scss index 5facb993..b4949655 100644 --- a/COPY-TO-ROOT-SASS/abridge.scss +++ b/COPY-TO-ROOT-SASS/abridge.scss @@ -183,6 +183,7 @@ //$top: true,//back to top button using CSS //$search: true,//search feature //$toc: true,//Table of Contents, page index / recent posts block + //$series: true,//Allows for posts to display in a series //$modifiers: true,//tiny modifier classes for sizing and spacing //$misc: false, //$grid: false,//Infinity Grid, column based layouts. diff --git a/sass/abridge.scss b/sass/abridge.scss index 70456954..09504e5f 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1567,7 +1567,6 @@ $series: true !default;//series of posts @if $series and $toc { - .series-toc { border-radius: var(--br); border-top: 5px solid var(--a1); @@ -1611,4 +1610,8 @@ $series: true !default;//series of posts } } } +} + +.toc h1 { + margin: 0; } \ No newline at end of file From ed9f6d45238f730ee2824ca1ff527fdda271e446 Mon Sep 17 00:00:00 2001 From: Hysterelius <71912794+Hysterelius@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:16:18 +1000 Subject: [PATCH 8/8] Cut down on excess CSS --- sass/abridge.scss | 56 +++++++++++++++++++++++---------------------- templates/page.html | 6 ++--- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/sass/abridge.scss b/sass/abridge.scss index 09504e5f..14a691b8 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1556,45 +1556,36 @@ $series: true !default;//series of posts //} } -.series-mobile { - max-width: 30rem; - min-width: 14rem; - padding: 0.15rem 1.25rem; - margin: var(--s1) auto; - border-radius: var(--br); - background-color: var(--c2); -} - - -@if $series and $toc { - .series-toc { +@if $series { + .series-mobile { + max-width: 30rem; + margin: var(--s2) auto; border-radius: var(--br); - border-top: 5px solid var(--a1); background-color: var(--c2); - margin-top: var(--s2); - padding: 0 var(--s2) var(--s2); - max-height: 100vh; - overflow: auto; - } - - .series-toc ol { - margin: 0; } - .series-toc li { - font-size: .875rem; + .series { + background-color: var(--c2); + max-height: 100vh; + padding: 0 var(--s2) var(--s2); + border-radius: var(--br); + border-top: 5px solid var(--a1); + overflow: auto; } - .series-toc h4 a { + .series h4 a { color: var(--f1); - font-weight: bold; + font-weight: 700; &:hover { color: var(--a3); - text-decoration: none; } } + + .series ol { + margin: 0; + } - .series-toc ol a { + .series ol a { color: var(--f1); &:hover { color: var(--a2); @@ -1602,6 +1593,17 @@ $series: true !default;//series of posts } } + .series li { + font-size: .875rem; + } +} + +@if $series and $toc { + .series-toc { + margin-top: var(--s2); + max-height: 100vh; + } + @if map-get($breakpoints, "md") { // mobile first is min-width for desktop instead of max-width for mobile @media (min-width: map-get($breakpoints, "md")) { diff --git a/templates/page.html b/templates/page.html index 038d0272..253b0d9e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -59,8 +59,8 @@ -
              - {{ tag.name }} ({{ parts_string }}) +
              + {{ tag.name }} ({{ parts_string }})
                {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -99,7 +99,7 @@
                {%- if page.extra.section %} -
                +
                {{ parts_string }}
                  {%- for inner in tag.pages | sort(attribute="year") %}