From e55841149d9259f26f4d117daba34b5666a52097 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 11 Sep 2026 22:02:29 +0200 Subject: src/themes/serene: Update to newest version --- src/themes/serene/templates/_base.html | 9 +- .../serene/templates/_components/collection.html | 129 +++++++++++++++++ src/themes/serene/templates/_components/prose.html | 72 ++++++++++ src/themes/serene/templates/_components/seo.html | 39 ++++++ src/themes/serene/templates/_footer.html | 24 ++-- src/themes/serene/templates/blog.html | 50 ------- src/themes/serene/templates/feed.xml | 40 +++--- src/themes/serene/templates/home.html | 69 ++++++---- src/themes/serene/templates/macros/collection.html | 153 --------------------- src/themes/serene/templates/macros/prose.html | 32 ----- src/themes/serene/templates/post.html | 71 ++++++---- src/themes/serene/templates/posts.html | 58 ++++++++ src/themes/serene/templates/prose.html | 38 +++-- .../serene/templates/shortcodes/caution.html | 2 - .../serene/templates/shortcodes/collection.html | 23 ---- src/themes/serene/templates/shortcodes/detail.html | 4 - src/themes/serene/templates/shortcodes/figure.html | 8 -- .../serene/templates/shortcodes/important.html | 2 - .../serene/templates/shortcodes/mermaid.html | 3 - src/themes/serene/templates/shortcodes/note.html | 2 - src/themes/serene/templates/shortcodes/quote.html | 10 -- src/themes/serene/templates/shortcodes/tip.html | 2 - .../serene/templates/shortcodes/warning.html | 2 - src/themes/serene/templates/tags/list.html | 16 ++- src/themes/serene/templates/tags/single.html | 20 ++- 25 files changed, 464 insertions(+), 414 deletions(-) create mode 100644 src/themes/serene/templates/_components/collection.html create mode 100644 src/themes/serene/templates/_components/prose.html create mode 100644 src/themes/serene/templates/_components/seo.html delete mode 100644 src/themes/serene/templates/blog.html delete mode 100644 src/themes/serene/templates/macros/collection.html delete mode 100644 src/themes/serene/templates/macros/prose.html create mode 100644 src/themes/serene/templates/posts.html delete mode 100644 src/themes/serene/templates/shortcodes/caution.html delete mode 100644 src/themes/serene/templates/shortcodes/collection.html delete mode 100644 src/themes/serene/templates/shortcodes/detail.html delete mode 100644 src/themes/serene/templates/shortcodes/figure.html delete mode 100644 src/themes/serene/templates/shortcodes/important.html delete mode 100644 src/themes/serene/templates/shortcodes/mermaid.html delete mode 100644 src/themes/serene/templates/shortcodes/note.html delete mode 100644 src/themes/serene/templates/shortcodes/quote.html delete mode 100644 src/themes/serene/templates/shortcodes/tip.html delete mode 100644 src/themes/serene/templates/shortcodes/warning.html (limited to 'src/themes/serene/templates') diff --git a/src/themes/serene/templates/_base.html b/src/themes/serene/templates/_base.html index 0bd7b3b..d1f2d48 100644 --- a/src/themes/serene/templates/_base.html +++ b/src/themes/serene/templates/_base.html @@ -1,3 +1,4 @@ +{% set color_scheme = config.extra.color_scheme if config.extra.color_scheme is defined else "auto" %} @@ -18,15 +19,15 @@ {% include "_head_extend.html" %} - - {% if not config.extra.force_theme %} + + {% if color_scheme == "auto" %} {% endif %} diff --git a/src/themes/serene/templates/_components/collection.html b/src/themes/serene/templates/_components/collection.html new file mode 100644 index 0000000..70a1d31 --- /dev/null +++ b/src/themes/serene/templates/_components/collection.html @@ -0,0 +1,129 @@ +{# + This component is used inside markdown content, which is rendered as a Tera + template first and *then* processed as markdown (zola >= 0.23). Its HTML + output must therefore stay markdown-safe: no blank lines in the middle of + an HTML block, and no lines indented by 4+ spaces. + + Collection file schema: + layout = "card" | "row" | "tile" | "gallery" (default "card") + flow = "stack" | "inline" | "grid" (default: card/gallery -> "stack", row/tile -> "inline") + [[item]] + title / subtitle / content / icon / image / link / badge / tags / featured / rotate +#} + +{% component collection(file: string, section) -%} +{%- set data = load_data(path="content" ~ section.path ~ file, format="toml") -%} +{%- set layout = data.layout if data.layout is defined else "card" -%} +{%- if layout not in ["card", "row", "tile", "gallery"] -%} +{%- set layout = "card" -%} +{%- endif -%} +{%- if data.flow is defined and data.flow in ["stack", "inline", "grid"] -%} +{%- set flow = data.flow -%} +{%- elif layout == "row" or layout == "tile" -%} +{%- set flow = "inline" -%} +{%- else -%} +{%- set flow = "stack" -%} +{%- endif -%} +{%- if layout == "card" and flow == "inline" -%} +{%- set flow = "grid" -%} +{%- endif -%} +
+{%- for item in data.item -%} +{%- set img_src = "" -%} +{%- if item.image is defined -%} +{%- if item.image is starting_with(pat="http") or item.image is starting_with(pat="/") or item.image is starting_with(pat="data:") -%} +{%- set img_src = item.image -%} +{%- else -%} +{%- set img_src = get_url(path=section.colocated_path ~ item.image) -%} +{%- endif -%} +{%- endif -%} +{%- set icon_src = "" -%} +{%- if item.icon is defined -%} +{%- if item.icon is starting_with(pat="http") or item.icon is starting_with(pat="/") or item.icon is starting_with(pat="data:") -%} +{%- set icon_src = item.icon -%} +{%- else -%} +{%- set icon_src = get_url(path=section.colocated_path ~ item.icon) -%} +{%- endif -%} +{%- endif -%} +{%- set external = item.link is defined and not item.link is starting_with(pat="/") -%} +{%- if layout == "card" -%} +
+{%- if img_src -%}
{{ item.title }}
{%- endif -%} +
+
+{%- if icon_src -%}{%- endif -%} +{%- if item.link -%} +{{ item.title }} +{%- else -%} +{{ item.title }} +{%- endif -%} +{%- if item.badge -%}{{ item.badge }}{%- endif -%} +
+{%- if item.subtitle -%} +
{{ item.subtitle | trim | markdown(inline=true) | trim | safe }}
+{%- endif -%} +{%- if item.content -%} +
+{{ item.content | trim | markdown | trim | safe }} +
+{%- endif -%} +{%- if item.tags -%} +
+{%- for tag in item.tags -%} +#{{ tag }} +{%- endfor -%} +
+{%- endif -%} +
+
+{%- elif layout == "row" -%} + + +{%- if icon_src -%}{%- endif -%} +{%- if item.link -%} +{{ item.title }} +{%- else -%} +{{ item.title }} +{%- endif -%} + +{%- if item.subtitle -%}{{ item.subtitle | trim | markdown(inline=true) | trim | safe }}{%- endif -%} +{%- if item.badge -%}{{ item.badge }}{%- endif -%} + +{%- elif layout == "tile" -%} +{%- if item.link -%} + +{%- else -%} + +{%- endif -%} + +{{ item.title }} +{%- if item.subtitle -%}{{ item.subtitle | trim | markdown(inline=true) | trim | safe }}{%- endif -%} + +{%- if img_src -%} +{{ item.title }} +{%- else -%} + +{%- endif -%} +{%- if item.link -%}{%- else -%}{%- endif -%} +{%- elif layout == "gallery" -%} +
+{%- if img_src -%}
{{ item.title }}
{%- endif -%} +
+{%- if item.link -%} +{{ item.title }} +{%- else -%} +{{ item.title }} +{%- endif -%} +{%- if item.subtitle -%}{{ item.subtitle | trim | markdown(inline=true) | trim | safe }}{%- endif -%} +{%- if item.content -%} +
+{{ item.content | trim | markdown | trim | safe }} +
+{%- endif -%} +{%- if item.badge -%}{{ item.badge }}{%- endif -%} +
+
+{%- endif -%} +{%- endfor -%} +
+{%- endcomponent collection %} diff --git a/src/themes/serene/templates/_components/prose.html b/src/themes/serene/templates/_components/prose.html new file mode 100644 index 0000000..c478a58 --- /dev/null +++ b/src/themes/serene/templates/_components/prose.html @@ -0,0 +1,72 @@ +{# + Components in this file are used inside markdown content, which is rendered + as a Tera template first and *then* processed as markdown (zola >= 0.23). + Their HTML output must therefore stay markdown-safe: no blank lines in the + middle of an HTML block, and no lines indented by 4+ spaces. +#} + +{% component back_link(path: string, config) %} +
+ +
+{% endcomponent back_link %} + + +{% component quote(cite: string = "") -%} +{%- set icon = load_data(path="icon/quote.svg") -%} +
+ +
+{{ body | markdown | trim | safe }} +
+{%- if cite -%} +{%- set from_text = "— " ~ cite -%} +
+{{ from_text | markdown | trim | safe }} +
+{%- endif -%} +
+{%- endcomponent quote %} + + +{% component detail(title: string = "", default_open: bool = false) -%} + +{{ title }} +{{ body | markdown | trim | safe }} + +{%- endcomponent detail %} + + +{% component figure(src: string, alt: string = "", caption: string = "", width: string = "", height: string = "", page = {}, section = {}) -%} +{%- if src is starting_with(pat="/") or src is starting_with(pat="http://") or src is starting_with(pat="https://") or src is starting_with(pat="//") or src is starting_with(pat="data:") -%} +{%- set image_src = src -%} +{%- elif page?.colocated_path -%} +{%- set image_src = get_url(path=page.colocated_path ~ src) -%} +{%- elif section?.colocated_path -%} +{%- set image_src = get_url(path=section.colocated_path ~ src) -%} +{%- else -%} +{%- set image_src = src -%} +{%- endif -%} +
+ +{%- if caption -%} +
{{ caption | trim | markdown | trim | safe }}
+{%- endif -%} +
+{%- endcomponent figure %} + + +{% component mermaid() -%} +
+{{ body }}
+
+{%- endcomponent mermaid %} + + +{% component youtube(id: string, autoplay: bool = false) -%} +
+ +
+{%- endcomponent youtube %} diff --git a/src/themes/serene/templates/_components/seo.html b/src/themes/serene/templates/_components/seo.html new file mode 100644 index 0000000..361d7d2 --- /dev/null +++ b/src/themes/serene/templates/_components/seo.html @@ -0,0 +1,39 @@ +{% component seo(title, desc, config, url = "", page_type = "website", image = "", colocated_path = "", published = "", updated = "", tags = [], lang = "") %} +{%- set og_image = "" -%} +{%- if image -%} + {%- if image is starting_with(pat="http://") or image is starting_with(pat="https://") or image is starting_with(pat="//") -%} + {%- set og_image = image -%} + {%- elif image is starting_with(pat="/") -%} + {%- set og_image = get_url(path=image) -%} + {%- elif colocated_path -%} + {%- set og_image = get_url(path=colocated_path ~ image) -%} + {%- else -%} + {%- set og_image = get_url(path=image) -%} + {%- endif -%} +{%- elif config.extra.og_image -%} + {%- if config.extra.og_image is starting_with(pat="http://") or config.extra.og_image is starting_with(pat="https://") or config.extra.og_image is starting_with(pat="//") -%} + {%- set og_image = config.extra.og_image -%} + {%- else -%} + {%- set og_image = get_url(path=config.extra.og_image) -%} + {%- endif -%} +{%- endif -%} + +{% if url %}{% endif %} + + + + +{% if url %}{% endif %} +{% if lang %}{% endif %} +{% if og_image %}{% endif %} +{% if page_type == "article" %} +{% if published %}{% endif %} +{% if updated %}{% endif %} +{% if tags %}{% for tag in tags %} +{% endfor %}{% endif %} +{% endif %} + + + +{% if og_image %}{% endif %} +{% endcomponent seo %} diff --git a/src/themes/serene/templates/_footer.html b/src/themes/serene/templates/_footer.html index e9c1dd1..78d62c8 100644 --- a/src/themes/serene/templates/_footer.html +++ b/src/themes/serene/templates/_footer.html @@ -1,5 +1,10 @@ -{% if config.extra.blog_section_path is defined %} -{% set blog_section_path = config.extra.blog_section_path %} +{% set show_rss = false %} +{% if section is defined and section.generate_feeds %} + {% set rss_path = section.path ~ config.feed_filenames[0] %} + {% set show_rss = true %} +{% elif config.generate_feeds %} + {% set rss_path = "/" ~ config.feed_filenames[0] %} + {% set show_rss = true %} {% endif %}
@@ -13,18 +18,11 @@
- {% if blog_section_path is defined and section.path is starting_with(blog_section_path) %} - {% if section.generate_feeds %} - {% set_global rss_path = blog_section_path ~ "/" ~ config.feed_filenames.0 %} - {% elif config.generate_feeds %} - {% set_global rss_path = "/" ~ config.feed_filenames.0 %} - {% endif %} - {% if section.generate_feeds or config.generate_feeds %} + {% if show_rss %} RSS {% endif %} - {% endif %} - {% if not config.extra.force_theme %} + {% if color_scheme == "auto" %} {% set moon_icon = load_data(path="icon/moon.svg") %} {% set sun_icon = load_data(path="icon/sun.svg") %}
-{% if blog_section_path is defined and section.path is starting_with(blog_section_path) %} -{% if section.generate_feeds or config.generate_feeds %} +{% if show_rss %} {% set link = get_url(path=rss_path) %}
@@ -49,4 +46,3 @@
{% endif %} -{% endif %} diff --git a/src/themes/serene/templates/blog.html b/src/themes/serene/templates/blog.html deleted file mode 100644 index 2519d28..0000000 --- a/src/themes/serene/templates/blog.html +++ /dev/null @@ -1,50 +0,0 @@ -{% import "macros/prose.html" as macros %} -{% extends "_base.html" %} - -{% block page %}blog{% endblock page%} -{% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %} -{% block title %}{{ section.title }}{% endblock title %} -{% block desc %} - {% if section.description %} - {% set desc = section.description %} - {% else %} - {% set desc = config.description %} - {% endif %} - -{% endblock desc %} - -{% block content %} -
- {{ macros::back_link(path = get_url(path="/")) }} - {% include "_section_title.html" %} -
- {% if section.extra.categorized %} - {% for category,posts in section.pages | sort(attribute="taxonomies.categories.0") | group_by(attribute="taxonomies.categories.0") %} - {% set category_name = category %} - {% if category is matching("^__[0-9]{2}__") %} - {% set category_name = category | split(pat="") | slice(start=7) | join(sep="") %} - {% endif %} -

{{ category_name }}

-
- {% for post in posts %} - - {{ post.title }} - {{ post.date | date(format=section.extra.date_format) }} - - {% endfor %} -
- {% endfor %} - {% else %} -
- {% for post in section.pages %} - - {{ post.title }} - {{ post.date | date(format=section.extra.date_format) }} - - {% endfor %} -
- {% endif %} -
- {% include "_footer.html" %} -
-{% endblock content %} diff --git a/src/themes/serene/templates/feed.xml b/src/themes/serene/templates/feed.xml index fe1f139..00aebe5 100644 --- a/src/themes/serene/templates/feed.xml +++ b/src/themes/serene/templates/feed.xml @@ -1,32 +1,34 @@ - {% if section.title %}{{ section.title }}{% else %}{{ config.title }}{% endif %} - {%- if section.description %} + {% if section is defined and section.title %}{{ section.title }}{% else %}{{ config.title }}{% endif %} + {%- if section is defined and section.description %} {{ section.description }} {%- elif config.description %} {{ config.description }} {%- endif %} - - - {{ last_updated | date(format="%+") }} + + + {% if last_updated is defined %} + {{ last_updated | date(format="%Y-%m-%dT%H:%M:%S%:z") }} + {% endif %} {{ feed_url | safe }} {%- for page in pages %} {{ page.title }} - {{ page.date | date(format="%+") }} - {{ page.updated | default(value=page.date) | date(format="%+") }} - {%- if page.summary %} - {{ page.summary }} - {%- endif %} - + {{ page.date | date(format="%Y-%m-%dT%H:%M:%S%:z") }} + {{ (page.updated or page.date) | date(format="%Y-%m-%dT%H:%M:%S%:z") }} + {{ page.permalink | safe }} - {{ page.content }} + {% if page.summary %} + {{ page.summary }} + {% endif %} + {{ page.content }} {%- endfor %} - \ No newline at end of file + diff --git a/src/themes/serene/templates/home.html b/src/themes/serene/templates/home.html index f899884..e074268 100644 --- a/src/themes/serene/templates/home.html +++ b/src/themes/serene/templates/home.html @@ -4,22 +4,28 @@ {% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %} {% block title %}{{ config.title }}{% endblock title %} {% block desc %} - + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = section.lang %}{% endif -%} + {{ }} {% endblock desc %} {% block head %} -{% if config.markdown.highlight_theme == "css" %} - {% if config.extra.force_theme == "dark" %} - +{% if config.markdown.highlighting.style == "class" %} + {% if color_scheme == "dark" %} + {% else %} - + {% endif %} {% endif %} -{% if section.extra.math %} - - - - +{% set enable_math = section.extra.math if section.extra.math is defined else (config.extra.math if config.extra.math is defined else false) %} +{% if enable_math %} + + + + -{% if section.extra.mermaid %} +{% set enable_mermaid = section.extra.mermaid if section.extra.mermaid is defined else (config.extra.mermaid if config.extra.mermaid is defined else false) %} +{% if enable_mermaid %} {% endif %} diff --git a/src/themes/serene/templates/macros/collection.html b/src/themes/serene/templates/macros/collection.html deleted file mode 100644 index 796eae1..0000000 --- a/src/themes/serene/templates/macros/collection.html +++ /dev/null @@ -1,153 +0,0 @@ -{% macro card(item) %} -
-
- {% if item.icon %} -
- icon -
- {% endif %} - {% if item.link %} - {{ item.title }} - {% else %} -
{{ item.title }}
- {% endif %} - {% if item.date %} -
{{ item.date }}
- {% endif %} -
- {% if item.subtitle %} -
{{ item.subtitle }}
- {% endif %} -
{{ item.content | trim | markdown | safe }}
- {% if item.tags %} -
- {% for tag in item.tags %} -
#{{ tag }}
- {% endfor %} -
- {% endif %} -
-{% endmacro %} - - -{% macro card_simple(item) %} -
-
- {% if item.icon %} -
- icon -
- {% endif %} - {% if item.link %} - {{ item.title }} - {% else %} -
{{ item.title }}
- {% endif %} -
{{ item.content | trim | markdown | safe }}
- {% if item.date %} -
{{ item.date }}
- {% endif %} -
-
{{ item.content | trim | markdown | safe }}
-
-{% endmacro %} - - -{% macro entry(item) %} -{% if item.link %} - -{% else %} -
-{% endif %} - {% if item.icon %} -
- icon -
- {% endif %} - {% if item.title or item.subtitle %} -
- {% if item.title %} -
{{ item.title }}
- {% endif %} - {% if item.subtitle %} -
{{ item.subtitle }}
- {% endif %} -
- {% endif %} -{% if item.link %} -
-{% else %} -
-{% endif %} -{% endmacro %} - - -{% macro box(item) %} - -{% endmacro %} - - -{% macro art(item) %} -
-
- {{ item.title }} -
-
- {% if item.link %} - {{ item.title }} - {% else %} -
{{ item.title }}
- {% endif %} - {% if item.subtitle %} -
{{ item.subtitle }}
- {% endif %} - {% if item.content %} -
{{ item.content }}
- {% endif %} - {% if item.footer %} - - {% endif %} -
-
-{% endmacro %} - - -{% macro art_simple(item) %} -
-
- {{ item.title }} -
-
- {% if item.link %} - {{ item.title }} - {% else %} -
{{ item.title }}
- {% endif %} - {% if item.subtitle %} -
{{ item.subtitle }}
- {% endif %} -
-
-{% endmacro %} diff --git a/src/themes/serene/templates/macros/prose.html b/src/themes/serene/templates/macros/prose.html deleted file mode 100644 index bd9a894..0000000 --- a/src/themes/serene/templates/macros/prose.html +++ /dev/null @@ -1,32 +0,0 @@ -{% macro back_link(path) %} -
- -
-{% endmacro %} - - -{% macro callout(name) %} -
- {% set icon = load_data(path="icon/" ~ name ~ ".svg") %} - {% if title %} -

- - {{ icon | safe }} - - {{ title }} -

-
- {{ body | markdown | safe }} -
- {% else %} -
- {{ icon | safe }} -
-
- {{ body | markdown | safe }} -
- {% endif %} -
-{% endmacro %} diff --git a/src/themes/serene/templates/post.html b/src/themes/serene/templates/post.html index 24fe0cd..07f9782 100644 --- a/src/themes/serene/templates/post.html +++ b/src/themes/serene/templates/post.html @@ -1,15 +1,13 @@ -{% import "macros/prose.html" as macros %} {% extends "_base.html" %} {% block page %}post{% endblock page %} {% block lang -%} -{%- set blog_section_path = config.extra.blog_section_path | trim_start_matches(pat="/") -%} -{%- set section_md_path = blog_section_path ~ "/_index.md" -%} -{%- set section = get_section(path=section_md_path, metadata_only=true) -%} +{%- set section = get_section(path=page.ancestors | last, metadata_only=true) -%} {%- if page.extra.lang %}{{page.extra.lang}}{% elif section.extra.lang %}{{section.extra.lang}}{% else %}{{page.lang}}{% endif -%} {%- endblock lang %} {% block title %}{{ page.title }}{% endblock title %} {% block desc %} + {%- set section = get_section(path=page.ancestors | last, metadata_only=true) -%} {% if page.summary %} {% set desc = page.summary %} {% elif page.description %} @@ -19,18 +17,30 @@ {% else %} {% set desc = config.description %} {% endif %} - + {%- if page.extra.lang %}{% set og_lang = page.extra.lang %}{% elif section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = page.lang %}{% endif -%} + {{ }} {% endblock desc %} {% block head %} -{% if config.markdown.highlight_theme == "css" %} - +{% if config.markdown.highlighting.style == "class" %} + {% endif %} -{% if page.extra.math %} - - - - +{% set enable_math = page.extra.math if page.extra.math is defined else (section.extra.math if section.extra.math is defined else (config.extra.math if config.extra.math is defined else false)) %} +{% if enable_math %} + + + + -{% if page.extra.mermaid %} +{% set enable_mermaid = page.extra.mermaid if page.extra.mermaid is defined else (section.extra.mermaid if section.extra.mermaid is defined else (config.extra.mermaid if config.extra.mermaid is defined else false)) %} +{% if enable_mermaid %} {% endif %} diff --git a/src/themes/serene/templates/posts.html b/src/themes/serene/templates/posts.html new file mode 100644 index 0000000..9b3dec1 --- /dev/null +++ b/src/themes/serene/templates/posts.html @@ -0,0 +1,58 @@ +{% extends "_base.html" %} + +{% block page %}blog{% endblock page%} +{% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %} +{% block title %}{{ section.title }}{% endblock title %} +{% block desc %} + {% if section.description %} + {% set desc = section.description %} + {% else %} + {% set desc = config.description %} + {% endif %} + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = section.lang %}{% endif -%} + {{ }} +{% endblock desc %} + +{% block content %} +
+ {{ }} + {% include "_section_title.html" %} +
+ {% set date_format = section.extra.date_format if section.extra.date_format is defined else (config.extra.date_format if config.extra.date_format is defined else "%b %-d, %Y") %} + {% if section.extra.categorized %} + {% set categorized_posts = [post for post in section.pages if post.taxonomies?.categories] %} + {% set categories = [post.taxonomies.categories[0] for post in categorized_posts] | unique | sort %} + {% for category in categories %} + {% set posts = [post for post in categorized_posts if post.taxonomies.categories[0] == category] %} + {% set category_name = category %} + {% if category is matching(pat="^__[0-9]{2}__") %} + {% set category_name = category[6:] %} + {% endif %} +

{{ category_name }}

+
+ {% for post in posts %} + + {{ post.title }} + {{ post.date | date(format=date_format) }} + + {% endfor %} +
+ {% endfor %} + {% else %} +
+ {% for post in section.pages %} + + {{ post.title }} + {{ post.date | date(format=date_format) }} + + {% endfor %} +
+ {% endif %} +
+ {% include "_footer.html" %} +
+{% endblock content %} diff --git a/src/themes/serene/templates/prose.html b/src/themes/serene/templates/prose.html index 661c408..114ff16 100644 --- a/src/themes/serene/templates/prose.html +++ b/src/themes/serene/templates/prose.html @@ -1,4 +1,3 @@ -{% import "macros/prose.html" as macros %} {% extends "_base.html" %} {% block page %}prose-page{% endblock page %} @@ -12,18 +11,24 @@ {% else %} {% set desc = config.description %} {% endif %} - + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = section.lang %}{% endif -%} + {{ }} {% endblock desc %} {% block head %} -{% if config.markdown.highlight_theme == "css" %} - +{% if config.markdown.highlighting.style == "class" %} + {% endif %} -{% if section.extra.math %} - - - - +{% set enable_math = section.extra.math if section.extra.math is defined else (config.extra.math if config.extra.math is defined else false) %} +{% if enable_math %} + + + + -{% if section.extra.mermaid %} +{% set enable_mermaid = section.extra.mermaid if section.extra.mermaid is defined else (config.extra.mermaid if config.extra.mermaid is defined else false) %} +{% if enable_mermaid %} {% endif %} diff --git a/src/themes/serene/templates/shortcodes/caution.html b/src/themes/serene/templates/shortcodes/caution.html deleted file mode 100644 index 7d1797f..0000000 --- a/src/themes/serene/templates/shortcodes/caution.html +++ /dev/null @@ -1,2 +0,0 @@ -{% import "macros/prose.html" as macros %} -{{ macros::callout(name="caution") }} diff --git a/src/themes/serene/templates/shortcodes/collection.html b/src/themes/serene/templates/shortcodes/collection.html deleted file mode 100644 index c217a0c..0000000 --- a/src/themes/serene/templates/shortcodes/collection.html +++ /dev/null @@ -1,23 +0,0 @@ -{% import 'macros/collection.html' as marcos -%} - -{% set data = load_data(path="content" ~ section.path ~ file, format="toml") %} - -
-{% for item in data.collection %} - {% if item.type == "card" %} - {{ marcos::card(item=item) }} - {% elif item.type == "card_simple" %} - {{ marcos::card_simple(item=item) }} - {% elif item.type == "entry" %} - {{ marcos::entry(item=item) }} - {% elif item.type == "box" %} - {{ marcos::box(item=item) }} - {% elif item.type == "art" %} - {{ marcos::art(item=item) }} - {% elif item.type == "art_simple" %} - {{ marcos::art_simple(item=item) }} - {% elif item.type == "br" %} -
- {% endif %} -{% endfor %} -
diff --git a/src/themes/serene/templates/shortcodes/detail.html b/src/themes/serene/templates/shortcodes/detail.html deleted file mode 100644 index 0d34a74..0000000 --- a/src/themes/serene/templates/shortcodes/detail.html +++ /dev/null @@ -1,4 +0,0 @@ -
- {{ title }} - {{ body | markdown | safe }} -
diff --git a/src/themes/serene/templates/shortcodes/figure.html b/src/themes/serene/templates/shortcodes/figure.html deleted file mode 100644 index 8a4123f..0000000 --- a/src/themes/serene/templates/shortcodes/figure.html +++ /dev/null @@ -1,8 +0,0 @@ -
- - {% if via %} -
via
- {% else %} -
{{ caption }}
- {% endif %} -
\ No newline at end of file diff --git a/src/themes/serene/templates/shortcodes/important.html b/src/themes/serene/templates/shortcodes/important.html deleted file mode 100644 index 451c141..0000000 --- a/src/themes/serene/templates/shortcodes/important.html +++ /dev/null @@ -1,2 +0,0 @@ -{% import "macros/prose.html" as macros %} -{{ macros::callout(name="important") }} diff --git a/src/themes/serene/templates/shortcodes/mermaid.html b/src/themes/serene/templates/shortcodes/mermaid.html deleted file mode 100644 index 3d3725d..0000000 --- a/src/themes/serene/templates/shortcodes/mermaid.html +++ /dev/null @@ -1,3 +0,0 @@ -
-  {{ body }}
-
\ No newline at end of file diff --git a/src/themes/serene/templates/shortcodes/note.html b/src/themes/serene/templates/shortcodes/note.html deleted file mode 100644 index b16657b..0000000 --- a/src/themes/serene/templates/shortcodes/note.html +++ /dev/null @@ -1,2 +0,0 @@ -{% import "macros/prose.html" as macros %} -{{ macros::callout(name="note") }} diff --git a/src/themes/serene/templates/shortcodes/quote.html b/src/themes/serene/templates/shortcodes/quote.html deleted file mode 100644 index c7e3c37..0000000 --- a/src/themes/serene/templates/shortcodes/quote.html +++ /dev/null @@ -1,10 +0,0 @@ -
- {% set icon = load_data(path="icon/quote.svg") %} - -
{{ body | markdown | safe }}
- {% if cite %} -
- {{ "— " ~ cite | markdown | safe }} -
- {% endif %} -
\ No newline at end of file diff --git a/src/themes/serene/templates/shortcodes/tip.html b/src/themes/serene/templates/shortcodes/tip.html deleted file mode 100644 index 8904437..0000000 --- a/src/themes/serene/templates/shortcodes/tip.html +++ /dev/null @@ -1,2 +0,0 @@ -{% import "macros/prose.html" as macros %} -{{ macros::callout(name="tip") }} diff --git a/src/themes/serene/templates/shortcodes/warning.html b/src/themes/serene/templates/shortcodes/warning.html deleted file mode 100644 index 0964b15..0000000 --- a/src/themes/serene/templates/shortcodes/warning.html +++ /dev/null @@ -1,2 +0,0 @@ -{% import "macros/prose.html" as macros %} -{{ macros::callout(name="warning") }} diff --git a/src/themes/serene/templates/tags/list.html b/src/themes/serene/templates/tags/list.html index bde1123..e2d48d7 100644 --- a/src/themes/serene/templates/tags/list.html +++ b/src/themes/serene/templates/tags/list.html @@ -1,26 +1,32 @@ -{% import "macros/prose.html" as macros %} {% extends "_base.html" %} {% block page %}tag-list{% endblock page%} {% block lang -%} -{% set blog_section_path = config.extra.blog_section_path | trim_start_matches(pat="/") %} +{% set blog_section_path = config.extra.blog_section_path | trim_start(pat="/") %} {% set section_md_path = blog_section_path ~ "/_index.md"%} {% set section = get_section(path=section_md_path, metadata_only=true) %} {%- if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ lang }}{% endif -%} {%- endblock lang %} {% block title %}Tags{% endblock title %} {% block desc %} - + {%- set blog_section_path = config.extra.blog_section_path | trim_start(pat="/") -%} + {%- set section = get_section(path=blog_section_path ~ "/_index.md", metadata_only=true) -%} + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = lang %}{% endif -%} + {{ }} {% endblock desc %} {% block content %}
- {{ macros::back_link(path = get_url(path="/")) }} + {{ }}

Tags

{% for tag in terms -%} - # {{ tag.name | lower }} + # {{ tag.name | lower }} {% endfor %}
diff --git a/src/themes/serene/templates/tags/single.html b/src/themes/serene/templates/tags/single.html index 1ce059a..ea9f360 100644 --- a/src/themes/serene/templates/tags/single.html +++ b/src/themes/serene/templates/tags/single.html @@ -1,30 +1,38 @@ -{% import "macros/prose.html" as macros %} {% extends "_base.html" %} {% block page %}tag-single{% endblock page %} {% block lang -%} -{% set blog_section_path = config.extra.blog_section_path | trim_start_matches(pat="/") %} +{% set blog_section_path = config.extra.blog_section_path | trim_start(pat="/") %} {% set section_md_path = blog_section_path ~ "/_index.md"%} {% set section = get_section(path=section_md_path, metadata_only=true) %} {%- if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ lang }}{% endif -%} {%- endblock lang %} {% block title %}{{section.title}}{% endblock title %} {% block desc %} - + {%- set blog_section_path = config.extra.blog_section_path | trim_start(pat="/") -%} + {%- set section = get_section(path=blog_section_path ~ "/_index.md", metadata_only=true) -%} + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = lang %}{% endif -%} + {{ }} {% endblock desc %} {% block content %}
- {{ macros::back_link(path = get_url(path="/tags")) }} + {% set tags_taxonomy = get_taxonomy(kind="tags") %} + {{ }}
# {{ term.name }}
+ {% set date_format = section.extra.date_format if section.extra.date_format is defined else (config.extra.date_format if config.extra.date_format is defined else "%b %-d, %Y") %} {% for post in term.pages %} - + {{ post.title }} - {{ post.date | date(format=section.extra.date_format) }} + {{ post.date | date(format=date_format) }} {% endfor %}
-- cgit v1.3.1