From 08f406c44c861a914c8b63fab454250f8a4c4b36 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Wed, 20 Sep 2023 00:25:21 -0700 Subject: refactor nav, blocks, macros, templates. fix image shortcodes --- COPY-TO-ROOT-SASS/_extra.scss | 3 + COPY-TO-ROOT-SASS/abridge.scss | 8 +- config.toml | 24 +- content/_index.fr.md | 1 + content/_index.md | 1 + content/archive/_index.fr.md | 3 + content/archive/_index.md | 3 + content/blog/_index.fr.md | 5 + content/blog/_index.md | 5 + content/images/_index.md | 3 + content/images/ferris-gesture.svg | 1 + content/images/ferris.svg | 1 + content/overview-abridge/index.fr.md | 2 - content/overview-images/index.fr.md | 12 +- content/overview-images/index.md | 12 +- content/overview-math.fr.md | 2 +- content/overview-math.md | 2 +- content/overview-rich-content/ferris-gesture.svg | 1 - content/overview-rich-content/ferris.svg | 1 - content/pages/contact.fr.md | 22 +- content/pages/contact.md | 24 +- content/pages/privacy.md | 2 +- sass/abridge.scss | 335 ++++++++----------- templates/404.html | 2 +- templates/archive.html | 8 +- templates/base.html | 122 ++++--- templates/categories/list.html | 2 +- templates/categories/single.html | 2 +- templates/contact.fr.html | 49 --- templates/contact.html | 49 --- templates/index.html | 14 +- templates/macros/head.html | 406 ----------------------- templates/macros/macros.html | 33 +- templates/macros/page.html | 7 - templates/macros/seo.html | 140 ++++++++ templates/macros/social.html | 58 ---- templates/page.html | 62 ++-- templates/pages.html | 19 +- templates/partials/head.html | 131 ++++++++ templates/partials/head_js.html | 165 +++++++++ templates/partials/social.html | 63 ++++ templates/shortcodes/img.html | 9 +- templates/shortcodes/imgswap.html | 17 +- templates/shortcodes/showdata.html | 10 + templates/tags/list.html | 2 +- templates/tags/single.html | 2 +- 46 files changed, 919 insertions(+), 926 deletions(-) create mode 100644 COPY-TO-ROOT-SASS/_extra.scss create mode 100644 content/blog/_index.fr.md create mode 100644 content/blog/_index.md create mode 100644 content/images/_index.md create mode 100644 content/images/ferris-gesture.svg create mode 100644 content/images/ferris.svg delete mode 100644 content/overview-rich-content/ferris-gesture.svg delete mode 100644 content/overview-rich-content/ferris.svg delete mode 100644 templates/contact.fr.html delete mode 100644 templates/contact.html delete mode 100644 templates/macros/head.html delete mode 100644 templates/macros/page.html create mode 100644 templates/macros/seo.html delete mode 100644 templates/macros/social.html create mode 100644 templates/partials/head.html create mode 100644 templates/partials/head_js.html create mode 100644 templates/partials/social.html diff --git a/COPY-TO-ROOT-SASS/_extra.scss b/COPY-TO-ROOT-SASS/_extra.scss new file mode 100644 index 0000000..42d9392 --- /dev/null +++ b/COPY-TO-ROOT-SASS/_extra.scss @@ -0,0 +1,3 @@ +/****************************************************************************** + * Extra - Put your extra SASS/CSS here, it will get bundled with abridge.css + *****************************************************************************/ diff --git a/COPY-TO-ROOT-SASS/abridge.scss b/COPY-TO-ROOT-SASS/abridge.scss index b494965..5b64dd1 100644 --- a/COPY-TO-ROOT-SASS/abridge.scss +++ b/COPY-TO-ROOT-SASS/abridge.scss @@ -182,13 +182,13 @@ //$form: true,//Form elements (non-button) //$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 + //$blocks: true,//css classes for block formatting, eg: recent posts, table of contents, series navigation + //$modifiers: true,//tiny modifier classes for sizing, spacing, etc. //$misc: false, - //$grid: false,//Infinity Grid, column based layouts. + //$grid: true,//Infinity Grid, column based layouts. //$syntax: true,//syntax highlighting for code blocks ); +@use "extra"; /****************************************************************************** * FONTS - Abridge by default uses the System Font Stack * https://css-tricks.com/snippets/css/system-font-stack/ diff --git a/config.toml b/config.toml index aeed1f6..8ff9621 100644 --- a/config.toml +++ b/config.toml @@ -61,6 +61,7 @@ Index = "Indice" Powered_by = "Propulsé" and = "et" About = "Sur" +Blog = "Blog" Posts = "Articles" Categories = "Catégories" Tags = "Mots-clés" @@ -96,15 +97,16 @@ flag.fr = "🇫🇷" ############################################################################### ### Layout & Format ### position: top, bottom, both, false(hidden) -### size: s95, s90, s85, s80, s75, s70, false(full size) +### size: s150, s140, s130, s120, s110, s95, s90, s85, s80, s75, s70, false(full size) ### divider: " " "·" "•" ############################################################################### menu = [ - {url = "about", name = "About", slash = true, blank = false}, - {url = "archive", name = "Posts", slash = true, blank = false}, -# {url = "categories", name = "Categories", slash = true, blank = false}, - {url = "tags", name = "Tags", slash = true, blank = false}, +# {url = "blog", name = "Blog", slash = true, blank = false, size="s110"}, + {url = "about", name = "About", slash = true, blank = false, size="s110"}, + {url = "archive", name = "Posts", slash = true, blank = false, size="s110"}, +# {url = "categories", name = "Categories", slash = true, blank = false, size="s110"}, + {url = "tags", name = "Tags", slash = true, blank = false, size="s110"}, ] menu_footer = [ {url = "about", name = "About", slash = true, blank = false}, @@ -113,16 +115,20 @@ menu_footer = [ {url = "sitemap.xml", name = "Sitemap", slash = false, blank = true}, ] +toc = true recent = true # TOC / index recent_items = 15 +series = true +#Series_parts = "$NUMBER_OF_PARTS part Series" + -meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, updated=false, categories_tags=true, divider=" " } -meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, updated=true, categories_tags=true, divider=" " } +meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, updated=false, categories_tags=true, divider=""} +meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, updated=true, categories_tags=true, divider=""} hide_section_dates = false # hides the date for sections that use posts.html as their template. hide_page_nextprev_titles = false # hides the next/previous titles for pages that use page.html as their template. -title_size_index = "s85" # size: s95, s90, s85, s80, s75, s70, false(full size) -footer_size = "s90" # size: s95, s90, s85, s80, s75, s70, false(full size) +title_size_index = "s85" +footer_size = "s90" footer_credit = true #footer_credit_override = '

Powered by Zola & Abridge

' #archive_reverse = true # Set to True to sort posts chronologically per year instead of newest first on the archive page: example.com/archive/ diff --git a/content/_index.fr.md b/content/_index.fr.md index 3511f76..a31a970 100644 --- a/content/_index.fr.md +++ b/content/_index.fr.md @@ -1,4 +1,5 @@ +++ paginate_by = 3 sort_by = "date" +template = "index.html" +++ diff --git a/content/_index.md b/content/_index.md index 3511f76..a31a970 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,4 +1,5 @@ +++ paginate_by = 3 sort_by = "date" +template = "index.html" +++ diff --git a/content/archive/_index.fr.md b/content/archive/_index.fr.md index b1a35cf..6234b9b 100644 --- a/content/archive/_index.fr.md +++ b/content/archive/_index.fr.md @@ -1,3 +1,6 @@ +++ template = "archive.html" + +[extra] +sec = "blog" +++ diff --git a/content/archive/_index.md b/content/archive/_index.md index b1a35cf..6234b9b 100644 --- a/content/archive/_index.md +++ b/content/archive/_index.md @@ -1,3 +1,6 @@ +++ template = "archive.html" + +[extra] +sec = "blog" +++ diff --git a/content/blog/_index.fr.md b/content/blog/_index.fr.md new file mode 100644 index 0000000..a31a970 --- /dev/null +++ b/content/blog/_index.fr.md @@ -0,0 +1,5 @@ ++++ +paginate_by = 3 +sort_by = "date" +template = "index.html" ++++ diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000..a31a970 --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,5 @@ ++++ +paginate_by = 3 +sort_by = "date" +template = "index.html" ++++ diff --git a/content/images/_index.md b/content/images/_index.md new file mode 100644 index 0000000..800a244 --- /dev/null +++ b/content/images/_index.md @@ -0,0 +1,3 @@ ++++ +render = false ++++ diff --git a/content/images/ferris-gesture.svg b/content/images/ferris-gesture.svg new file mode 100644 index 0000000..d819588 --- /dev/null +++ b/content/images/ferris-gesture.svg @@ -0,0 +1 @@ + diff --git a/content/images/ferris.svg b/content/images/ferris.svg new file mode 100644 index 0000000..1409b10 --- /dev/null +++ b/content/images/ferris.svg @@ -0,0 +1 @@ + diff --git a/content/overview-abridge/index.fr.md b/content/overview-abridge/index.fr.md index b4f84e6..3f307bc 100644 --- a/content/overview-abridge/index.fr.md +++ b/content/overview-abridge/index.fr.md @@ -11,8 +11,6 @@ tags = ["Features","Config"] toc = true +++ -A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing [abridge.css](https://github.com/Jieiku/abridge.css) (a class-light semantic HTML CSS Framework). Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://observatory.mozilla.org/analyze/abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page. - Un thème [Zola](https://getzola.org) rapide, léger et moderne utilisant [abridge.css](https://github.com/Jieiku/abridge.css) (un framework HTML CSS sémantique léger en classe ). Scores parfait [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) et [Observatory](https://observatory.mozilla.org/analyze/abridge.netlify.app). Voici une page [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md). diff --git a/content/overview-images/index.fr.md b/content/overview-images/index.fr.md index 8504e8a..96c899c 100644 --- a/content/overview-images/index.fr.md +++ b/content/overview-images/index.fr.md @@ -47,13 +47,13 @@ Cet article couvre les **shortcodes imgswap et img**. Les images peuvent égalem ## Utilisation (chemin racine /) ```rs -{{/* img(src="/overview-rich-content/ferris.svg" alt="Ferris le Rustacé") */}} +{{/* img(src="/images/ferris.svg" alt="Ferris le Rustacé") */}} ``` **Sortir** ```html -{{ img(src="/overview-rich-content/ferris.svg" alt="Ferris le Rustacé") }} +{{ img(src="/images/ferris.svg" alt="Ferris le Rustacé") }} ``` -{{ img(src="/overview-rich-content/ferris.svg" alt="Ferris le Rustacé") }} +{{ img(src="/images/ferris.svg" alt="Ferris le Rustacé") }} # Image SVG directement dans le code ```html @@ -99,10 +99,10 @@ Lorsque vous passez votre souris sur l'image, l'image à comparer s'affiche. ## Utilisation (chemin racine /) ```rs -{{/* imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") */}} +{{/* imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") */}} ``` **Sortir** ```html -{{ imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") }} +{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }} ``` -{{ imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") }} +{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }} diff --git a/content/overview-images/index.md b/content/overview-images/index.md index ed430db..6c515cd 100644 --- a/content/overview-images/index.md +++ b/content/overview-images/index.md @@ -47,13 +47,13 @@ This post covers the **imgswap and img shortcodes**. Images can also be embedded ## Usage (root path /) ```rs -{{/* img(src="/overview-rich-content/ferris.svg" alt="Ferris the Rustacean") */}} +{{/* img(src="/images/ferris.svg" alt="Ferris the Rustacean") */}} ``` **Output** ```html -{{ img(src="/overview-rich-content/ferris.svg" alt="Ferris the Rustacean") }} +{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }} ``` -{{ img(src="/overview-rich-content/ferris.svg" alt="Ferris the Rustacean") }} +{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }} # SVG image directly in code ```html @@ -99,10 +99,10 @@ When you hover your mouse over the image it will display the image to compare. ## Usage (root path /) ```rs -{{/* imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") */}} +{{/* imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") */}} ``` **Output** ```html -{{ imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") }} +{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }} ``` -{{ imgswap(main_src="/overview-rich-content/ferris.svg" swap_src="/overview-rich-content/ferris-gesture.svg") }} +{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }} diff --git a/content/overview-math.fr.md b/content/overview-math.fr.md index e24b4e6..7097702 100644 --- a/content/overview-math.fr.md +++ b/content/overview-math.fr.md @@ -1,5 +1,5 @@ +++ -title = "Notations mathématiques" +title = "Notation mathématiques" description = "Exemple d'article présentant l'affichage des notations mathématiques, rendu possible par la bibliothèque KaTeX." date = 2021-05-05 updated = 2022-01-01 diff --git a/content/overview-math.md b/content/overview-math.md index c34d2f2..446f537 100644 --- a/content/overview-math.md +++ b/content/overview-math.md @@ -1,5 +1,5 @@ +++ -title = "Mathematical Notations" +title = "Mathematical Notation" description = "Sample article showcasing the display of Mathematical Notations, made possible by the KaTeX library." date = 2021-05-05 updated = 2022-01-01 diff --git a/content/overview-rich-content/ferris-gesture.svg b/content/overview-rich-content/ferris-gesture.svg deleted file mode 100644 index d819588..0000000 --- a/content/overview-rich-content/ferris-gesture.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/content/overview-rich-content/ferris.svg b/content/overview-rich-content/ferris.svg deleted file mode 100644 index 1409b10..0000000 --- a/content/overview-rich-content/ferris.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/content/pages/contact.fr.md b/content/pages/contact.fr.md index cae2626..27ad163 100644 --- a/content/pages/contact.fr.md +++ b/content/pages/contact.fr.md @@ -2,6 +2,26 @@ title = "Contact" description = "Pour nous joindre, veuillez utiliser le formulaire de contact sur cette page." path = "fr/contact" -template = "contact.fr.html" +template = "pages.html" draft = false +++ + +

Vous voulez entrer en contact ? Remplissez le formulaire ci-dessous pour m'envoyer un message et je vous répondrai dans les plus brefs délais !

+
+

+ + +

+

+ + +

+

+ + +

+
+

+ +

+
diff --git a/content/pages/contact.md b/content/pages/contact.md index 306b360..a16ed7e 100644 --- a/content/pages/contact.md +++ b/content/pages/contact.md @@ -2,6 +2,26 @@ title = "Contact" description = "To reach us please use the contact form on this page." path = "contact" -template = "contact.html" +template = "pages.html" draft = false -+++ \ No newline at end of file ++++ + +

Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!

+
+

+ + +

+

+ + +

+

+ + +

+
+

+ +

+
diff --git a/content/pages/privacy.md b/content/pages/privacy.md index 52bfc01..1b7eec5 100644 --- a/content/pages/privacy.md +++ b/content/pages/privacy.md @@ -12,4 +12,4 @@ draft = false - This site does not store data in the browser to be shared, sent, or sold to third-parties. - No personal information is shared, sent, or sold to third-parties. -**Effective Date:** _1st Jan 2022_ \ No newline at end of file +**Effective Date:** _1st Jan 2022_ diff --git a/sass/abridge.scss b/sass/abridge.scss index 14a691b..d844403 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -211,13 +211,13 @@ $button: true !default;//Form elements (button) $form: true !default;//Form elements (non-button) $top: true !default;//back to top button using CSS $search: true !default;//search feature -$toc: true !default;//Table of Contents, page index / recent posts block +$blocks: true !default;//css classes for block formatting, eg: recent posts, table of contents, series navigation $modifiers: true !default;//tiny modifier classes for sizing and spacing $imgswap: true !default;//Image Swap on hover/click $misc: false !default; -$grid: false !default;//Infinity Grid, column based layouts. +$grid: true !default;//Infinity Grid, column based layouts. $syntax: true !default;//syntax highlighting for code blocks -$series: true !default;//series of posts + /****************************************************************************** * Root element @@ -440,8 +440,7 @@ $series: true !default;//series of posts h6 { padding-left: 0; color: var(--f2); - margin-bottom: var(--s1); - margin-top: var(--s2); + margin: var(--s2) 0 var(--s1); font-weight: var(--fh); font-size: var(--fs); line-height: var(--lhh); @@ -473,7 +472,7 @@ $series: true !default;//series of posts color: var(--a2); text-decoration: underline; } - h1 a, h2 a, a.si, main nav a, nav > div > a { + h1 a, h2 a, main nav a, header span > a { color: var(--f2); text-decoration: none; font-weight: var(--fh); @@ -545,7 +544,7 @@ $series: true !default;//series of posts color: var(--f1); font-style: normal; font-weight: var(--fw); - font-size: var(--fs); + //font-size: var(--fs);//TODO: This caused the lists to be a different size than the rest of the page, it was quite jarring } // Lists @@ -657,29 +656,71 @@ $series: true !default;//series of posts } } @if $nav { - //https://github.com/raj457036/attriCSS - .on, - .on:visited {//pagination link styling - font-weight: var(--fh); - border: .1rem solid var(--c4); - border-radius: var(--br); - padding: .1rem var(--s1); + header > nav > div {//padding above nav divs in header + padding-top: var(--s2); } - .on:hover {//makes border of pagination links hover color - border-color: var(--a3); - .svgh { - background: var(--a3); - opacity: 1; + footer > div {//padding above social icons + padding-top: var(--s1); + } + header > nav, header > nav > div:nth-child(2) { + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + //margin: 0 auto; + h1 { + margin: 0;//right margin + } + span { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; } } - nav > div > a, header i, header .dropdown { - margin-right: .2rem; - vertical-align: middle; + + header > nav > div:nth-child(2) {//puts logo on left and menu/search on right + margin-left: auto; + justify-content: center; + a, i, .dropdown { + margin: 0 var(--s2) 0 0;//right margin + } + } + // mobile first layout. + header nav { + margin: var(--s1) auto 0; // keeps top menu/search centered in mobile view + flex-direction: column;// column layout for mobile view + div:nth-child(2) { + margin: auto; // keeps top menu/search centered in mobile view + } + } + nav { + align-items: center; + justify-content: center;//center pagination horizontally + display: flex; + } + + //dropdown menu used for lang, etc. + .dropdown { + display: inline-block; + position: relative; + z-index: 99; font-weight: var(--fh); + font-size: 1.4rem; } - main nav {//pagination - a,span { - margin: .2rem; + .dropdown-content { + display: none; + position: absolute; + z-index: 99; + font-weight: var(--fh); + font-size: 1.4rem; + } + .dropdown:hover .dropdown-content { + display: block; + z-index: 99; + a { + text-decoration: none; } } article nav {//prev/next page title @@ -687,7 +728,6 @@ $series: true !default;//series of posts text-align: right; } } - //footer nav > footer nav { a { margin: .2rem; @@ -696,46 +736,28 @@ $series: true !default;//series of posts margin-bottom: .2rem; } } - header > nav > div:first-of-type {//Keep the logo from wrapping - display: inline; - min-width: fit-content; - padding-right: var(--s1);//add some spacing between nav divs - } - header > nav > div:nth-child(2) {//puts logo on left and menu/search on right - margin-left: auto; - padding-right: var(--s1);//add some spacing between nav divs - } - // mobile first layout. - header nav { - flex-direction: column;// column layout for mobile view - h1 { - margin: var(--s2) 0 var(--s1);//adds more padding above for mobile view - } - div { - margin: auto; // keeps top menu/search centered in mobile view + + //pagination + main nav { + margin-top: var(--s2);//pagination margin + a,span { + margin: .2rem; } } - nav > div { - margin: var(--s1) 0; + .on, + .on:visited {//pagination link styling + font-weight: var(--fh); + border: .1rem solid var(--c4); + border-radius: var(--br); + padding: .1rem var(--s1); } - nav { - align-items: center; - justify-content: center;//center pagination horizontally - display: flex; - div h2 { - font-size: 1rem; - &:hover { - color: var(--a3); - } - } - h1 { - margin-bottom: 0; - margin-top: 0.2rem; + .on:hover {//makes border of pagination links hover color + border-color: var(--a3); + .svgh { + background: var(--a3); + opacity: 1; } } - main nav { - margin-top: var(--s2);//pagination margin - } .outp { padding: 0 .26rem .2rem; } @@ -757,40 +779,17 @@ $series: true !default;//series of posts .mode:hover, .cnav { color: var(--a1);//pagination color current page } - //dropdown menu used for lang, etc. - .dropdown { - display: inline-block; - position: relative; - z-index: 99; - font-weight: var(--fh); - font-size: 1.4rem; - } - .dropdown-content { - display: none; - position: absolute; - z-index: 99; - font-weight: var(--fh); - font-size: 1.4rem; - } - .dropdown:hover .dropdown-content { - display: block; - z-index: 99; - a { - text-decoration: none; - } - } + // breakpoint makes header responsive for desktop layouts // mobile first is min-width for desktop instead of max-width for mobile @if map-get($breakpoints, "md") { @media (min-width: map-get($breakpoints, "md")) { - header > nav > div { - margin: var(--s1) 0;// desktop layout - } - header nav { + header nav, header > nav > div:nth-child(2) { flex-direction: row;// row layout for desktop view - h1 { - margin: var(--s1) 0;// desktop layout - } + margin: 0 0 0 auto;// desktop layout + } + header > nav > div { + padding-top: var(--s1); } } } @@ -1153,7 +1152,7 @@ $series: true !default;//series of posts @if map-get($breakpoints, "md") { @media (min-width: map-get($breakpoints, "md")) { .searchd > input { - max-width: 15.3rem; + max-width: 15rem; flex-grow: 0; } #suggestions { @@ -1165,52 +1164,49 @@ $series: true !default;//series of posts } } } -@if $toc { - main { - .toc { - max-width: 15rem; - min-width: 14rem; - margin-left: var(--s1); - } - .toc-item { - padding: .4rem 0 0; - color: var(--f1); - } - .toc-item a, .toc-item-child a { - color: var(--f1); - &:hover { - cursor: pointer; - color: var(--a2); - text-decoration: underline; - } - } - .toc-item a.active, .toc-item-child a.active { - color: var(--a2); - } - .toc-item-child { - padding: 0 var(--s1); - color: var(--f1); - } +@if $blocks { + .block { + max-width: 30rem; + margin: var(--s2) auto; } - .toc { - display: none; + .sblock { + max-width: 15rem; + min-width: 14rem; + margin-left: var(--s1); } - .toc-sticky { + .blockdiv { border-radius: var(--br); border-top: 5px solid var(--a1); background-color: var(--c2); - position: sticky; - top: var(--s2); margin-top: var(--s2); padding: 0 var(--s2) var(--s2); max-height: 100vh; overflow: auto; + a { + color: var(--f1); + &:hover { + color: var(--a2); + } + } + ol { + margin: 0; + } + } + .sticky { + position: sticky; + top: var(--s2); + } + .sblock { + display: none;//hide in mobile view } @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")) { - .toc { - display: unset; + .sblock { + display: unset;//show in desktop view + } + .block { + display: none;//hide in desktop view, TODO: depending on what blocks get used for, this could be a problem in the future, should be fine for now. } } } @@ -1247,18 +1243,25 @@ $series: true !default;//series of posts @if $grid { // https://github.com/vladocar/Basic.css [style*="--c:"], section>section { + flex: var(--c,1); + margin: var(--s1); color: var(--f2); padding: var(--s1); - margin: var(--s1); text-align: center; } section { display: flex; flex-flow: row wrap; - } - [style*="--c:"], section>section { - flex:var(--c,1); - margin:var(--s1); + article { + div { + text-align: center; + } + h1, h2, h3 { + text-align: center; + } + padding: 20px 30px; + min-width: 340px;// limits to 3 columns wide, TODO: solution to limit number of columns + } } } @if $enable-icons { @@ -1345,15 +1348,21 @@ $series: true !default;//series of posts } @if $modifiers { .sum, .sum p {margin: .2rem 0} + .s150 {font-size: 1.5em} + .s140 {font-size: 1.4em} + .s130 {font-size: 1.3em} + .s120 {font-size: 1.2em} + .s110 {font-size: 1.1em} .s95 {font-size: .95em} .s90 {font-size: .90em} .s85 {font-size: .85em} .s80 {font-size: .80em} .s75 {font-size: .75em} .s70 {font-size: .70em} - .hpad {padding: 0 .2rem} - .rpad {padding-right: .2rem} - .si {font-size: 1.5em} + .hpad {padding: 0 var(--s1)} + .rpad {padding-right: var(--s1)} + .tpad {padding-top: var(--s1)} + .b {font-weight: var(--fh)} } @if $syntax { // Unstyled Text Color, and background color @@ -1555,65 +1564,3 @@ $series: true !default;//series of posts // 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/404.html b/templates/404.html index 7b7c325..07f32b3 100644 --- a/templates/404.html +++ b/templates/404.html @@ -14,7 +14,7 @@ {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_404=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_404=true) }} {%- endblock seo %} {%- block content %} diff --git a/templates/archive.html b/templates/archive.html index 8ac3cfc..e4f7e06 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -19,13 +19,17 @@ This Template can also be used as the rendering template for Sections, eg: examp {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} {%- block content %} {#- The following line is checking if the template is being used for the archive page or a section #} {%- if current_path is matching("^(/[[:alpha:]][[:alpha:]])?/archive/$") %} - {%- set sec = "" %} + {%- if section.extra.sec %} + {%- set sec = section.extra.sec ~ "/" %} + {%- else %} + {%- set sec = "" %} + {%- endif %} {%- else %} {%- set langpath = "/" %} {%- if lang != config.default_language %} diff --git a/templates/base.html b/templates/base.html index 8d85516..b3dfec8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,21 +1,13 @@ -{%- import 'macros/head.html' as macros_head %} -{%- import "macros/social.html" as social_macros %} -{%- import "macros/page.html" as page_macros %} +{%- import 'macros/seo.html' as macros_seo %} {%- import "macros/macros.html" as macros %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} - {{- macros_head::theme(config=config) }} - {{- macros_head::stylesheets(config=config) }} - - - - {{- macros_head::stylesheets_preload(config=config) }} - {{- macros_head::js(config=config) }} - - {{- macros_head::feed(config=config) }} + {%- include "partials/head.html" %} + + {#- SEO: title, description, etc #} {%- block seo %} {%- if config.extra.title_separator %} {%- set title_separator = " " ~ config.extra.title_separator ~ " " -%} @@ -23,15 +15,11 @@ {%- set title_separator = " | " -%} {%- endif %} {%- endblock seo %} - - - - - {{- macros_head::security(config=config) }} - {{- macros_head::favicons(config=config) }} + {%- block comments_init %} {%- endblock comments_init %} - + + {%- include "partials/head_js.html" %} {%- block header %} @@ -39,7 +27,7 @@ {%- if config.extra.sitedesc %} {%- if config.description %} @@ -119,11 +116,12 @@
{%- endif %}
- {{- social_macros::social_links(config=config) }} + {%- include "partials/social.html" %} {#- Copyright START #} {%- if config.extra.copyright | default(value=true) -%} {%- set current_year = now() | date(format="%Y") %} + {%- set current_year = '' ~ current_year ~ '' %} {%- if config.extra.copyright_override -%} {%- if lang != config.default_language %} diff --git a/templates/categories/list.html b/templates/categories/list.html index bbfb6dc..641fcc4 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -14,7 +14,7 @@ {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} {%- block content %} diff --git a/templates/categories/single.html b/templates/categories/single.html index 7e85232..be219aa 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -14,7 +14,7 @@ {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} {%- block content %} diff --git a/templates/contact.fr.html b/templates/contact.fr.html deleted file mode 100644 index d23569d..0000000 --- a/templates/contact.fr.html +++ /dev/null @@ -1,49 +0,0 @@ -{# Cette page affiche la page de contact, par exemple: example.com/contact/ #} - -{% extends "base.html" %} - -{%- block seo %} - {{- super() }} - {%- set title_addition = "" %} - - {%- if page.title and config.title %} - {%- set title = page.title %} - {%- set title_addition = title_separator ~ config.title %} - {%- elif page.title %} - {%- set title = page.title %} - {%- else %} - {%- set title = config.title %} - {%- endif %} - - {%- if page.description %} - {%- set description = page.description %} - {%- else %} - {%- set description = config.description %} - {%- endif %} - - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }} -{%- endblock seo %} - -{%- block content %} -
-

Vous voulez entrer en contact ? Remplissez le formulaire ci-dessous pour m'envoyer un message et je vous répondrai dans les plus brefs délais !

-
-

- - -

-

- - -

-

- - -

-
-

- -

-
-
-{%- endblock content %} diff --git a/templates/contact.html b/templates/contact.html deleted file mode 100644 index 526bb61..0000000 --- a/templates/contact.html +++ /dev/null @@ -1,49 +0,0 @@ -{# This Page Shows the contact page eg: example.com/contact/ #} - -{% extends "base.html" %} - -{%- block seo %} - {{- super() }} - {%- set title_addition = "" %} - - {%- if page.title and config.title %} - {%- set title = page.title %} - {%- set title_addition = title_separator ~ config.title %} - {%- elif page.title %} - {%- set title = page.title %} - {%- else %} - {%- set title = config.title %} - {%- endif %} - - {%- if page.description %} - {%- set description = page.description %} - {%- else %} - {%- set description = config.description %} - {%- endif %} - - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }} -{%- endblock seo %} - -{%- block content %} -
-

Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!

-
-

- - -

-

- - -

-

- - -

-
-

- -

-
-
-{%- endblock content %} diff --git a/templates/index.html b/templates/index.html index a364912..705c630 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,6 +1,6 @@ {# -This Page Shows the Posts with a short summary on the index: example.com/ -This Template can also be used as the rendering template for Sections, eg: example.com/blog/ example.com/software/ +This Tempalte Shows a paginated page of the Posts of a section with a short summary. +This Template can also be used directly for the index eg: example.com/ or as the rendering template for Sections, eg: example.com/blog/ example.com/software/ #} {%- extends "base.html" %} @@ -26,7 +26,7 @@ This Template can also be used as the rendering template for Sections, eg: examp {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} @@ -80,12 +80,12 @@ This Template can also be used as the rendering template for Sections, eg: examp {%- else %} {%- set section_item = get_section(path=sec ~ "_index." ~ lang ~ ".md") %} {%- endif %} -
-
-

{%- if lang != config.default_language %}{{ trans(key="Recent_Posts" | safe, lang=lang) }}{% else %}Recent Posts{% endif %}

+
+
+ {%- if lang != config.default_language %}{{ trans(key="Recent_Posts" | safe, lang=lang) }}{% else %}Recent Posts{% endif %} {%- set recent_items=config.extra.recent_items | default(value=9) -%} {%- for page in section_item.pages | slice(end=recent_items) %} - {{- page_macros::page_listing(page=page, config=config) }} + {{- macros::page_listing(page=page, config=config) }} {%- endfor %}
diff --git a/templates/macros/head.html b/templates/macros/head.html deleted file mode 100644 index 3ed3af0..0000000 --- a/templates/macros/head.html +++ /dev/null @@ -1,406 +0,0 @@ -{#- Theme Switcher Button to toggle between dark/light #} -{%- macro theme(config) %} - {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} - - {%- if config.extra.js_switcher | default(value=true) %} - {%- set js_theme="js/theme.min.js" %} - {%- if config.extra.js_switcher_default %} - {%- if config.extra.js_switcher_default == "light" %}{% set js_theme="js/theme_light.min.js" %}{% endif %} - {%- endif %} - - {%- endif %} -{%- endmacro %} - -{%- macro stylesheets(config) %} - {%- set stylesheets=config.extra.stylesheets | default(value=[ "abridge.css" ]) -%} - {%- if stylesheets %}{%- for i in stylesheets %} - - {%- endfor %}{%- endif %} -{%- endmacro %} - - - -{%- macro stylesheets_preload(config) %} - {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} - -{%- if config.extra.fonts %}{%- for i in config.extra.fonts %} - {%- if i.url is matching("^http[s]?://") %} - - {%- else %} - - {%- endif %} -{%- endfor %}{%- endif %} - -{%- if config.extra.fontawesome %} - -{%- endif %} - -{%- if config.extra.math or page.extra.math %} - - {%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%} - {%- if katex_css %}{%- if katex_css is matching("^http[s]?://") %} - - {%- else %} - - {%- endif %}{%- endif %} - -{%- endif %} - -{%- endmacro %} - - - -{%- macro feed(config) %} - {%- if config.generate_feed %} - - {%- endif %} -{%- endmacro %} - - - -{%- macro js(config) %} - {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} - {%- set search_library=config.extra.search_library | default(value="elasticlunr") -%} - - {%- set preStyle = false %} - - {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} - {%- if i.url is matching("^http[s]?://") %} - {%- set preStyle = true %} - {%- endif %} - {%- endfor %}{%- endif %} - - {%- if config.extra.fontawesome %} - {%- set preStyle = true %} - {%- endif %} - - {%- if config.extra.math or page.extra.math %} - {%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%} - {%- if katex_css %} - {%- set preStyle = true %} - {%- endif %} - {%- endif %} - - -{%- if config.extra.js_bundle %} - {%- if config.build_search_index %} - {%- if config.extra.pwa | default(value=false) %} - - {%- else %} - - {%- endif %} - - {%- else %} - {%- if config.extra.pwa | default(value=false) %} - - {%- else %} - - {%- endif %} - {%- endif %} - - {%- if config.build_search_index %} - {%- if search_library == "elasticlunr" %} - {%- if lang != "en" %} - - - {%- endif %} - {%- endif %} - {%- endif %} - -{%- else %}{#- Not js_bundle #} - - {%- if preStyle == true %} - {%- if config.extra.js_prestyle | default(value=true) %} - - {%- endif %} - {%- endif %} - - {%- if config.extra.js_switcher | default(value=true) %} - - {%- endif %} - - {%- if config.extra.js_email_encode | default(value=true) %} - - {%- endif %} - - {%- if config.extra.js_copycode | default(value=true) %} - - {%- endif %} - - {%- if config.extra.pwa | default(value=false) %} - - {%- endif %} - - {%- if search_library == "tinysearch" %} - - {%- elif search_library == "stork" %} - - {%- elif config.build_search_index %} - - {%- set search_index_format="elasticlunr_json" -%} - {%- if config.search.index_format %} - {%- if config.search.index_format == "elasticlunr_javascript" %} - {%- set search_index_format="elasticlunr_javascript" -%} - {%- endif %} - {%- endif %} - - {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} - {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} - {%- if search_index_format == "elasticlunr_javascript" %}{#- Javascript index format #} - - - - {%- if uglyurls %} - - {%- else %} - - {%- endif %} - - {%- else %} - - {%- endif %} - - {%- if lang != "en" %} - - - {%- endif %} - - {%- endif %} - -{%- endif %} - - -{#- https://katex.org/docs/autorender.html #} -{#- https://github.com/KaTeX/KaTeX/ #} -{#- https://github.com/KaTeX/KaTeX/tree/main/contrib/mathtex-script-type/ #} -{%- if config.extra.math or page.extra.math %} - -{%- set katex_bundle=config.extra.katex_bundle | default(value="js/katexbundle.min.js") -%} -{%- if katex_bundle %} - -{%- else %} - - {%- set katex_js=config.extra.katex_js | default(value="js/katex.min.js") -%} - {%- if katex_js %}{%- if katex_js is matching("^http[s]?://") %} - - {%- else %} - - {%- endif %}{%- endif %} - - {%- set mathtex_js=config.extra.mathtex_js | default(value="js/mathtex-script-type.min.js") -%} - {%- if mathtex_js %}{%- if mathtex_js is matching("^http[s]?://") %} - - {%- else %} - - {%- endif %}{%- endif %} - - {%- if config.extra.math_auto_render or page.extra.math_auto_render %} - {%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="js/katex-auto-render.min.js") -%} - {%- if katex_autorender_js %} - {%- if katex_autorender_js is matching("^http[s]?://") %} - - {%- else %} - - {%- endif %} - {%- endif %} - {%- set katex_options=config.extra.katex_options | default(value="js/katexoptions.js") -%} - {%- if katex_options %} - - {%- endif %} - {%- endif %} -{%- endif %} - -{%- endif %} - -{%- endmacro %} - - - -{%- macro favicons(config) %} - {%- if config.extra.favicon_theme_color %} - - {%- endif %} - - {%- if config.extra.favicon_ms_color %} - - {%- endif %} - - {%- if config.extra.webmanifest %} - - {%- endif %} - - {%- if config.extra.favicon_mask and config.extra.favicon_mask_color %} - - {%- endif %} - - {%- if config.extra.favicon_svg %} - - {%- endif %} - - {%- if config.extra.favicon180 %} - - {%- endif %} - - {%- if config.extra.favicon32 %} - - {%- endif %} - - {%- if config.extra.favicon16 %} - - {%- endif %} -{%- endmacro %} - - - -{%- macro security(config) %} - {%- if config.extra.security_header_referrer %} - - {%- endif %} - {%- if config.extra.security_header_csp %} - - {%- endif %} -{%- endmacro %} - - - -{#- type: website or article, generally setting article for blog articles -#} -{#- page_images: using for the blog single template page -#} -{#- page_section: the blog single template page have to pass the parameter -#} -{#- is_404: using for the 404.html template -#} -{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00" ) %} -{%- if is_404 -%} - -{%- else -%} - - - -{%- endif -%} - -{%- if current_url %} - {%- set page_url = current_url %} -{%- else %} - {%- set page_url = get_url(path="404.html", trailing_slash=true) %} -{%- endif %} - {{ title ~ title_addition }} - -{%- if config.extra.author %} - -{%- endif %} -{%- if config.extra.facebook_publisher %} - -{%- endif %} - -{%- if config.extra.facebook_author %} - -{%- endif %} -{%- if page.description %} - -{%- else %} - -{%- endif %} - -{%- if page.extra.keywords and config.extra.keywords %} - -{%- elif page.extra.keywords %} - -{%- elif config.extra.keywords %} - -{%- endif %} - -{#- Extra SEO START #} -{%- if config.extra.seo | default(value=true) %} -{%- if not is_404 %} - -{%- if config.extra.google %} - -{%- endif %} - -{%- if config.extra.bing %} - -{%- endif %} - - - -{%- if page.description %} - - -{%- else %} - - -{%- endif %} - -{%- if page.title %} - - -{%- else %} - - -{%- endif %} - - -{#- SEO MEDIA START #} -{%- if page.extra.thumbnail %} - - - - -{%- elif page.extra.static_thumbnail %} - - {%- if page.extra.static_thumbnail is matching("^http[s]?://") %} - - - {%- else %} - - - {%- endif %} - -{%- elif config.extra.banner %} - - - - -{%- else %} - - -{%- endif %} - -{%- if config.extra.open.audio %} - -{%- endif %} - -{%- if config.extra.open.locale %} - -{%- endif %} - -{%- if config.extra.open.videos %} - {%- for video in config.extra.open.videos %} - - {%- endfor %} -{%- endif %} - -{#- SEO MEDIA END #} - - - -{%- if page.updated %} - -{%- elif page.date %} - -{%- else %} - -{%- endif %} - -{%- if config.extra.twitter_meta %} - - -{%- endif %} - - - -{%- endif %} -{%- endif %} -{#- Extra SEO END #} -{%- endmacro %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 000130a..66673d1 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,9 +1,21 @@ +{%- macro page_listing(page, config) %} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} + +{%- endmacro page_listing %} + + + {%- macro title_post(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}

{{ page.title }}

{%- endmacro title_post %} + + {%- macro meta_post(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -29,7 +41,7 @@ {#- divider #} {%- if config.extra.meta_post.author %} {%- if config.extra.meta_post.readtime or config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %}   {%- endif %} + {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %} {%- endif %} {%- endif %} @@ -37,7 +49,7 @@ {%- if config.extra.meta_post.readtime %} {%- if config.extra.icon_read %} {% endif %} {{ page.reading_time }} {{ config.extra.meta_post.readstring | default(value="min") }} {#- divider #} {%- if config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{%- endif %} + {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} {#- Date #} {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %} {% endif %} @@ -51,7 +63,7 @@ {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} {#- divider #} {%- if config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} + {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Updated #} {%- if config.extra.meta_post.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} @@ -65,7 +77,7 @@ {%- else %} {{ page.updated | date(format="%B %d, %Y") }} {%- endif %} {#- divider #} {%- if config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} + {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Categories #} {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} @@ -74,6 +86,8 @@ {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- endmacro meta_post %} + + {%- macro title_index(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -81,6 +95,7 @@ {%- endmacro title_index %} + {%- macro meta_index(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -106,7 +121,7 @@ {#- divider #} {%- if config.extra.meta_index.author %} {%- if config.extra.meta_index.readtime or config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %}   {%- endif %} + {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %} {%- endif %} {%- endif %} @@ -114,7 +129,7 @@ {%- if config.extra.meta_index.readtime %} {%- if config.extra.icon_read %} {% endif %} {{ page.reading_time }} {{ config.extra.meta_index.readstring | default(value="min") }} {#- divider #} {%- if config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{%- endif %} + {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} {#- Date #} {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %} {% endif %} @@ -128,7 +143,7 @@ {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} {#- divider #} {%- if config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} + {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Updated #} {%- if config.extra.meta_index.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} @@ -143,7 +158,7 @@ {#- divider #} {%- if config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} + {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Categories #} {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} @@ -154,7 +169,6 @@ - {%- macro footer(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -178,6 +192,7 @@ {%- endmacro footer %} + {%- macro pagination(paginator, config)%} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} diff --git a/templates/macros/page.html b/templates/macros/page.html deleted file mode 100644 index 23b9e09..0000000 --- a/templates/macros/page.html +++ /dev/null @@ -1,7 +0,0 @@ -{%- macro page_listing(page, config) %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} - -{%- endmacro page_listing %} diff --git a/templates/macros/seo.html b/templates/macros/seo.html new file mode 100644 index 0000000..8d2ada1 --- /dev/null +++ b/templates/macros/seo.html @@ -0,0 +1,140 @@ +{#- type: website or article, generally setting article for blog articles -#} +{#- page_images: using for the blog single template page -#} +{#- page_section: the blog single template page have to pass the parameter -#} +{#- is_404: using for the 404.html template -#} + +{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00" ) %} + +{%- if is_404 -%} + +{%- else -%} + + + +{%- endif -%} + +{%- if current_url %} + {%- set page_url = current_url %} +{%- else %} + {%- set page_url = get_url(path="404.html", trailing_slash=true) %} +{%- endif %} + {{ title ~ title_addition }} + +{%- if config.extra.author %} + +{%- endif %} +{%- if config.extra.facebook_publisher %} + +{%- endif %} + +{%- if config.extra.facebook_author %} + +{%- endif %} +{%- if page.description %} + +{%- else %} + +{%- endif %} + +{%- if page.extra.keywords and config.extra.keywords %} + +{%- elif page.extra.keywords %} + +{%- elif config.extra.keywords %} + +{%- endif %} + +{#- Extra SEO START #} +{%- if config.extra.seo | default(value=true) %} +{%- if not is_404 %} + +{%- if config.extra.google %} + +{%- endif %} + +{%- if config.extra.bing %} + +{%- endif %} + + + +{%- if page.description %} + + +{%- else %} + + +{%- endif %} + +{%- if page.title %} + + +{%- else %} + + +{%- endif %} + + +{#- SEO MEDIA START #} +{%- if page.extra.thumbnail %} + + + + +{%- elif page.extra.static_thumbnail %} + + {%- if page.extra.static_thumbnail is matching("^http[s]?://") %} + + + {%- else %} + + + {%- endif %} + +{%- elif config.extra.banner %} + + + + +{%- else %} + + +{%- endif %} + +{%- if config.extra.open.audio %} + +{%- endif %} + +{%- if config.extra.open.locale %} + +{%- endif %} + +{%- if config.extra.open.videos %} + {%- for video in config.extra.open.videos %} + + {%- endfor %} +{%- endif %} + +{#- SEO MEDIA END #} + + + +{%- if page.updated %} + +{%- elif page.date %} + +{%- else %} + +{%- endif %} + +{%- if config.extra.twitter_meta %} + + +{%- endif %} + + + +{%- endif %} +{%- endif %} +{#- Extra SEO END #} +{%- endmacro %} diff --git a/templates/macros/social.html b/templates/macros/social.html deleted file mode 100644 index 8661976..0000000 --- a/templates/macros/social.html +++ /dev/null @@ -1,58 +0,0 @@ -{%- macro social_links(config) %} - -{%- endmacro %} diff --git a/templates/page.html b/templates/page.html index 253b0d9..198e190 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,4 +1,4 @@ -{# This Page Shows the Individual Blog Posts#} +{# This Template Shows the Individual Blog Posts#} {% extends "base.html" %} @@ -27,7 +27,7 @@ {%- set page_section = "" %} {%- endif %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }} {%- endblock seo %} {%- block comments_init %} @@ -45,33 +45,35 @@ {{- macros::meta_post(page=page, config=config) }} {%- endif %}{%- endif %} - + {# In Page Series Navigation #} + {%- if config.extra.series | default(value=true) %} {%- 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" %} + {%- set parts_string = config.extra.Series_parts | default(value="Series") | replace(from="$NUMBER_OF_PARTS", to=page_num) %} {% endif -%} - - -
- {{ tag.name }} ({{ parts_string }}) -
    - {%- for inner in tag.pages | sort(attribute="year") %} - {%- if inner.content == page.content %} -
  1. {{ inner.title }}
  2. - {% else %} -
  3. {{ inner.title }}
  4. - {%- endif %} - {%- endfor %} -
+
+
+ {{ tag.name }} ({{ parts_string }}) +
    + {%- 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 %} + {%- endif %} {{ page.content | safe }} @@ -92,15 +94,16 @@ {%- endblock comments_body %} {%- block toc %} - {%- if page.extra.toc and config.extra.recent %} + {%- if config.extra.toc | default(value=true) %} + {%- if page.extra.toc %} {%- set toc = page.toc %} {%- endif %} {%- if toc %} - -
+ +
{%- if page.extra.section %} -
- {{ parts_string }} +
+ {{ parts_string }}
    {%- for inner in tag.pages | sort(attribute="year") %} {%- if inner.content == page.content %} @@ -113,16 +116,16 @@
{%- endif %} -
- {%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %} +
+ {%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %} {%- for h in toc %} -
- {{ h.title }} + {%- if h.children %} {%- for h2 in h.children %} -
- - {{ h2.title }} + {%- endfor %} {%- endif %} @@ -130,6 +133,7 @@
{%- endif %} + {%- endif %} {%- endblock toc %} {%- endblock content %} diff --git a/templates/pages.html b/templates/pages.html index 4ef44f5..72f4071 100644 --- a/templates/pages.html +++ b/templates/pages.html @@ -1,4 +1,8 @@ -{# This Page Shows the 'Pages' (abridge/content/pages) eg: example.com/about/ example.com/privacy/ #} +{# +This Template is for the 'Pages' (abridge/content/pages) eg: example.com/about/ example.com/privacy/ +This Template can also be used as a home page for the index, eg: example.com/ +Some people prefer a landing page for the index, and then use a separate paginated page for their blog. +#} {% extends "base.html" %} @@ -9,24 +13,35 @@ {%- if page.title and config.title %} {%- set title = page.title %} {%- set title_addition = title_separator ~ config.title %} + {%- elif section.title and config.title %} + {%- set title = section.title %} + {%- set title_addition = title_separator ~ config.title %} {%- elif page.title %} {%- set title = page.title %} + {%- elif section.title %} + {%- set title = section.title %} {%- else %} {%- set title = config.title %} {%- endif %} {%- if page.description %} {%- set description = page.description %} + {%- elif section.description %} + {%- set description = section.description %} {%- else %} {%- set description = config.description %} {%- endif %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description) }} {%- endblock seo %} {%- block content %}
+{%- if page.content %} {{ page.content | safe }} +{%- elif section.content %} +{{ section.content | safe }} +{%- endif %}
{%- endblock content %} diff --git a/templates/partials/head.html b/templates/partials/head.html new file mode 100644 index 0000000..4e6b713 --- /dev/null +++ b/templates/partials/head.html @@ -0,0 +1,131 @@ + +{#- Theme Switcher Button to toggle between dark/light #} + {%- set integrity = config.extra.integrity | default(value=true) -%} + {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + + {%- if config.extra.js_switcher | default(value=true) %} + {%- set js_theme="js/theme.min.js" %} + {%- if config.extra.js_switcher_default %} + {%- if config.extra.js_switcher_default == "light" %}{% set js_theme="js/theme_light.min.js" %}{% endif %} + {%- endif %} + + {%- endif %} + + + + + +{#- Style Sheets #} + {%- set stylesheets=config.extra.stylesheets | default(value=[ "abridge.css" ]) -%} + {%- if stylesheets %}{%- for i in stylesheets %} + + {%- endfor %}{%- endif %} + + + + + +{#- meta tags #} + + + + + + + + + + + + + +{#- Security: CSP, referrer #} + {%- if config.extra.security_header_referrer %} + + {%- endif %} + {%- if config.extra.security_header_csp %} + + {%- endif %} + + + + + +{#- Favicons #} + {%- if config.extra.favicon_theme_color %} + + {%- endif %} + + {%- if config.extra.favicon_ms_color %} + + {%- endif %} + + {%- if config.extra.webmanifest %} + + {%- endif %} + + {%- if config.extra.favicon_mask and config.extra.favicon_mask_color %} + + {%- endif %} + + {%- if config.extra.favicon_svg %} + + {%- endif %} + + {%- if config.extra.favicon180 %} + + {%- endif %} + + {%- if config.extra.favicon32 %} + + {%- endif %} + + {%- if config.extra.favicon16 %} + + {%- endif %} + + + + + +{#- Style Sheets Preload #} + {%- set integrity = config.extra.integrity | default(value=true) -%} + {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + +{%- if config.extra.fonts %}{%- for i in config.extra.fonts %} + {%- if i.url is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %} +{%- endfor %}{%- endif %} + +{%- if config.extra.fontawesome %} + +{%- endif %} + +{%- if config.extra.math or page.extra.math %} + + {%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%} + {%- if katex_css %}{%- if katex_css is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %}{%- endif %} + +{%- endif %} + + + + + +{#- Rss / Atom Feed #} + {%- if config.generate_feed %} + + {%- endif %} + + + + + +{#- End of head partial -#} diff --git a/templates/partials/head_js.html b/templates/partials/head_js.html new file mode 100644 index 0000000..9a5604a --- /dev/null +++ b/templates/partials/head_js.html @@ -0,0 +1,165 @@ +{#- JAVASCRIPT #} + {%- set integrity = config.extra.integrity | default(value=true) -%} + {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + {%- set search_library=config.extra.search_library | default(value="elasticlunr") -%} + + {%- set preStyle = false %} + + {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} + {%- if i.url is matching("^http[s]?://") %} + {%- set preStyle = true %} + {%- endif %} + {%- endfor %}{%- endif %} + + {%- if config.extra.fontawesome %} + {%- set preStyle = true %} + {%- endif %} + + {%- if config.extra.math or page.extra.math %} + {%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%} + {%- if katex_css %} + {%- set preStyle = true %} + {%- endif %} + {%- endif %} + + +{%- if config.extra.js_bundle %} + {%- if config.build_search_index %} + {%- if config.extra.pwa | default(value=false) %} + + {%- else %} + + {%- endif %} + + {%- else %} + {%- if config.extra.pwa | default(value=false) %} + + {%- else %} + + {%- endif %} + {%- endif %} + + {%- if config.build_search_index %} + {%- if search_library == "elasticlunr" %} + {%- if lang != "en" %} + + + {%- endif %} + {%- endif %} + {%- endif %} + +{%- else %}{#- Not js_bundle #} + + {%- if preStyle == true %} + {%- if config.extra.js_prestyle | default(value=true) %} + + {%- endif %} + {%- endif %} + + {%- if config.extra.js_switcher | default(value=true) %} + + {%- endif %} + + {%- if config.extra.js_email_encode | default(value=true) %} + + {%- endif %} + + {%- if config.extra.js_copycode | default(value=true) %} + + {%- endif %} + + {%- if config.extra.pwa | default(value=false) %} + + {%- endif %} + + {%- if search_library == "tinysearch" %} + + {%- elif search_library == "stork" %} + + {%- elif config.build_search_index %} + + {%- set search_index_format="elasticlunr_json" -%} + {%- if config.search.index_format %} + {%- if config.search.index_format == "elasticlunr_javascript" %} + {%- set search_index_format="elasticlunr_javascript" -%} + {%- endif %} + {%- endif %} + + {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} + {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} + {%- if search_index_format == "elasticlunr_javascript" %}{#- Javascript index format #} + + + + {%- if uglyurls %} + + {%- else %} + + {%- endif %} + + {%- else %} + + {%- endif %} + + {%- if lang != "en" %} + + + {%- endif %} + + {%- endif %} + +{%- endif %} + + + + + +{#- Katex #} +{#- https://katex.org/docs/autorender.html #} +{#- https://github.com/KaTeX/KaTeX/ #} +{#- https://github.com/KaTeX/KaTeX/tree/main/contrib/mathtex-script-type/ #} +{%- if config.extra.math or page.extra.math %} + +{%- set katex_bundle=config.extra.katex_bundle | default(value="js/katexbundle.min.js") -%} +{%- if katex_bundle %} + +{%- else %} + + {%- set katex_js=config.extra.katex_js | default(value="js/katex.min.js") -%} + {%- if katex_js %}{%- if katex_js is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %}{%- endif %} + + {%- set mathtex_js=config.extra.mathtex_js | default(value="js/mathtex-script-type.min.js") -%} + {%- if mathtex_js %}{%- if mathtex_js is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %}{%- endif %} + + {%- if config.extra.math_auto_render or page.extra.math_auto_render %} + {%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="js/katex-auto-render.min.js") -%} + {%- if katex_autorender_js %} + {%- if katex_autorender_js is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %} + {%- endif %} + {%- set katex_options=config.extra.katex_options | default(value="js/katexoptions.js") -%} + {%- if katex_options %} + + {%- endif %} + {%- endif %} +{%- endif %} + +{%- endif %} + + + + + + +{#- End of head_js partial -#} diff --git a/templates/partials/social.html b/templates/partials/social.html new file mode 100644 index 0000000..aaca83d --- /dev/null +++ b/templates/partials/social.html @@ -0,0 +1,63 @@ +{#- Social Footer Icons #} + + + + + + +{#- End of social partial -#} diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index f5754ce..ac3ba6b 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -1,15 +1,16 @@ {%- set img = src | split(pat="/") | last %} {%- set dirtest = src | trim_start_matches(pat="./") %} {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %} +{%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %} {%- if src is starting_with("./") and reldir %} {# Relative Path #} {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %} {%- set path = path ~ "/" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ path ~ img %} + {%- set metapath = pagepath ~ path ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} @@ -30,9 +31,9 @@ {%- set path = "" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ img %} + {%- set metapath = pagepath ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} diff --git a/templates/shortcodes/imgswap.html b/templates/shortcodes/imgswap.html index efcf6e7..80a3b74 100644 --- a/templates/shortcodes/imgswap.html +++ b/templates/shortcodes/imgswap.html @@ -2,15 +2,16 @@ {%- set img = main_src | split(pat="/") | last %} {%- set dirtest = main_src | trim_start_matches(pat="./") %} {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %} + {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %} {%- if main_src is starting_with("./") and reldir %} {# Relative Path #} {%- set path = main_src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %} {%- set path = path ~ "/" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ path ~ img %} + {%- set metapath = pagepath ~ path ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} @@ -31,9 +32,9 @@ {%- set path = "" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ img %} + {%- set metapath = pagepath ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} @@ -55,9 +56,9 @@ {%- set path = path ~ "/" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ path ~ img %} + {%- set metapath = pagepath ~ path ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} @@ -78,9 +79,9 @@ {%- set path = "" %} {%- if not w or not h %} {%- if lang != config.default_language %} - {%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %} + {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %} {%- else %} - {%- set metapath = page.path ~ img %} + {%- set metapath = pagepath ~ img %} {%- endif %} {%- set meta = get_image_metadata(path=metapath) %} {%- set w = meta.width %} diff --git a/templates/shortcodes/showdata.html b/templates/shortcodes/showdata.html index 9c14444..7f3d3bc 100644 --- a/templates/shortcodes/showdata.html +++ b/templates/shortcodes/showdata.html @@ -1,3 +1,5 @@ +{# showdata(src="../theme.toml" type="toml" key="min_version") #} + {%- if src and key and type %} {%- if src is matching("^http[s]?://") %} {% set data = load_data(url=src, format=type) %} @@ -5,4 +7,12 @@ {% set data = load_data(path=src, format=type) %} {%- endif %} {{ data[key] }} +{%- else %} + {# Load other file types as plain text #} + {%- if src is matching("^http[s]?://") %} + {% set data = load_data(url=src) %} + {%- else %} + {% set data = load_data(path=src) %} + {%- endif %} + {{ data }} {%- endif %} diff --git a/templates/tags/list.html b/templates/tags/list.html index 2124b02..4f53a58 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -14,7 +14,7 @@ {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} {%- block content %} diff --git a/templates/tags/single.html b/templates/tags/single.html index d21d9b0..a57b1f7 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -14,7 +14,7 @@ {%- set description = config.description %} - {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} + {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} {%- block content %} -- cgit v1.3.1