aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHysterelius2023-09-13 16:48:39 +1000
committerJieiku2023-09-19 11:17:05 -0700
commitb1be7cc6de3737ebbb1ae1485652e32a2888dbfc (patch)
treeb22bea2928384bc7acfb7b5eecfc10efcee4a50e
parentc44af9da6d9db0f420eabce146058ae0ac48b353 (diff)
downloadabridge-b1be7cc6de3737ebbb1ae1485652e32a2888dbfc.tar.gz
abridge-b1be7cc6de3737ebbb1ae1485652e32a2888dbfc.tar.bz2
abridge-b1be7cc6de3737ebbb1ae1485652e32a2888dbfc.zip
Multi Part Series Navigation
-rw-r--r--COPY-TO-ROOT-SASS/abridge.scss1
-rw-r--r--config.toml2
-rw-r--r--content/overview-math.fr.md1
-rw-r--r--content/overview-math.md1
-rw-r--r--sass/abridge.scss63
-rw-r--r--templates/page.html45
6 files changed, 113 insertions, 0 deletions
diff --git a/COPY-TO-ROOT-SASS/abridge.scss b/COPY-TO-ROOT-SASS/abridge.scss
index 5facb99..b494965 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/config.toml b/config.toml
index 52b8e18..aeed1f6 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 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/content/overview-math.fr.md b/content/overview-math.fr.md
index 4729e5a..e24b4e6 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 0a9931d..c34d2f2 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/sass/abridge.scss b/sass/abridge.scss
index 7208721..14a691b 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,65 @@ $syntax: true !default;//syntax highlighting for code blocks
// color: var(--h1);
//}
}
+
+@if $series {
+ .series-mobile {
+ max-width: 30rem;
+ margin: var(--s2) auto;
+ border-radius: var(--br);
+ background-color: var(--c2);
+ }
+
+ .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 h4 a {
+ color: var(--f1);
+ font-weight: 700;
+ &:hover {
+ color: var(--a3);
+ }
+ }
+
+ .series ol {
+ margin: 0;
+ }
+
+ .series ol a {
+ color: var(--f1);
+ &:hover {
+ color: var(--a2);
+ text-decoration: underline;
+ }
+ }
+
+ .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")) {
+ .series-mobile {
+ display: none;
+ }
+ }
+ }
+}
+
+.toc h1 {
+ margin: 0;
+} \ No newline at end of file
diff --git a/templates/page.html b/templates/page.html
index 6ca83d4..253b0d9 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -45,6 +45,35 @@
{{- macros::meta_post(page=page, config=config) }}
{%- endif %}{%- endif %}
+
+ {%- if 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 -%}
+
+
+
+ <div class="series-mobile series">
+ <a class="si" href="{{ tag.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag.name }} ({{ parts_string }})</a>
+ <ol>
+ {%- for inner in tag.pages | sort(attribute="year") %}
+ {%- if inner.content == page.content %}
+ <li><a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}"><b>{{ inner.title }}</b></a></li>
+ {% else %}
+ <li><a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a></li>
+ {%- endif %}
+ {%- endfor %}
+ </ol>
+ </div>
+ {%- endif %}
+
+
{{ page.content | safe }}
{%- if config.extra.meta_post.position %}
@@ -67,7 +96,23 @@
{%- set toc = page.toc %}
{%- endif %}
{%- if toc %}
+
<div class="toc">
+ {%- if page.extra.section %}
+ <div class="series-toc series">
+ <a class="si" href="{{ tag.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ parts_string }}</a>
+ <ol>
+ {%- for inner in tag.pages | sort(attribute="year") %}
+ {%- if inner.content == page.content %}
+ <li><a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}"><b>{{ inner.title }}</b></a></li>
+ {% else %}
+ <li><a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a></li>
+ {%- endif %}
+ {%- endfor %}
+ </ol>
+ </div>
+ {%- endif %}
+
<div class="toc-sticky">
<a class="si" href="#">{%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %}</a>
{%- for h in toc %}