From 65f135a6a2f7be105bfe9ce95796b2314627b20d Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 18 Jul 2023 13:23:00 -0700 Subject: Add Examples for Sections and Transparent Sections --- templates/archive.html | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 templates/archive.html (limited to 'templates/archive.html') diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..fdbb5e8 --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,68 @@ +{# +This Page Shows the Posts Grouped by Year: example.com/archive/ +This Template can also be used as the rendering template for Sections, eg: example.com/blog/ example.com/software/ +#} + +{% extends "base.html" %} + +{%- block seo %} + {{- super() }} + {%- set title = "Archive" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::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 = "" %} + {%- else %} + {%- set langpath = "/" %} + {%- if lang != config.default_language %} + {%- set langpath = "/" ~ lang ~ "/" %} + {%- endif %} + + {%- set sec = current_path | trim_start_matches(pat=langpath) | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %} + {%- set sec = sec ~ "/" %} + {%- endif %} + + {%- if lang == config.default_language %} + {%- set section_item = get_section(path=sec ~ "_index.md") %} + {%- else %} + {%- set section_item = get_section(path=sec ~ "_index." ~ lang ~ ".md") %} + {%- endif %} + {%- if sec != "" %} + {#- the section always overrides the config -#} + {%- if section_item.extra and 'hide_section_dates' in section_item.extra -%} + {%- set hide_section_dates = section_item.extra.hide_section_dates -%} + {%- elif config.extra.hide_section_dates -%} + {%- set hide_section_dates = true -%} + {%- endif -%} + {%- endif %} +
+ {%- if section_item.title %} +

{{ section_item.title }}

+ {%- endif %} + {{- section_item.content | safe }} + {%- for year, posts in section_item.pages | group_by(attribute="year") %} + {%- if not hide_section_dates %} + {%- if section_item.title %} +

{{ year }}

+ {%- else %} +

{{ year }}

+ {%- endif %} + {%- endif %} + {%- for post in posts %} +

{{ post.title }}{%- if not hide_section_dates %} - {%- endif %}

+ {%- endfor %} + {%- endfor %} +
+{%- endblock content %} -- cgit v1.3.1 From 3f5f755694eb6dfa18a9548af5f8c1c89ffa859b Mon Sep 17 00:00:00 2001 From: Jieiku Date: Fri, 21 Jul 2023 10:37:56 -0700 Subject: svg favicon, archive reverse --- config.toml | 2 ++ static/favicon.svg | 1 + static/logo.svg | 1 - templates/archive.html | 15 +++++++++++++++ templates/macros/head.html | 4 ++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 static/favicon.svg delete mode 100644 static/logo.svg (limited to 'templates/archive.html') diff --git a/config.toml b/config.toml index 46acb10..3d5addf 100644 --- a/config.toml +++ b/config.toml @@ -126,6 +126,7 @@ 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) 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/ ### Uncomment one of the below lines, or neither, depending on which type of logo you want to use: #logo = { file="logo.svg", width="32", height="32", alt="Abridge", text="bridge" } @@ -227,6 +228,7 @@ favicon_ms_color = "#333333" favicon_webmanifest = "site.webmanifest" # Used for android-chrome-512x512.png and android-chrome-192x192.png favicon_mask = "safari-pinned-tab.svg" # safari-pinned-tab.svg favicon_mask_color = "#ff9900" +favicon_svg = "favicon.svg" # favicon.svg favicon180 = "apple-touch-icon.png" # apple-touch-icon.png favicon32 = "favicon-32x32.png" # favicon-32x32.png favicon16 = "favicon-16x16.png" # favicon-16x16.png diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000..02f7d64 --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/logo.svg b/static/logo.svg deleted file mode 100644 index 02f7d64..0000000 --- a/static/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/templates/archive.html b/templates/archive.html index fdbb5e8..eff70a9 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -52,6 +52,20 @@ This Template can also be used as the rendering template for Sections, eg: examp

{{ section_item.title }}

{%- endif %} {{- section_item.content | safe }} + {%- if config.extra.archive_reverse %} + {%- for year, posts in section_item.pages | sort(attribute="year") | reverse | group_by(attribute="year") %} + {%- if not hide_section_dates %} + {%- if section_item.title %} +

{{ year }}

+ {%- else %} +

{{ year }}

+ {%- endif %} + {%- endif %} + {%- for post in posts %} +

{{ post.title }}{%- if not hide_section_dates %} - {%- endif %}

+ {%- endfor %} + {%- endfor %} + {%- else %} {%- for year, posts in section_item.pages | group_by(attribute="year") %} {%- if not hide_section_dates %} {%- if section_item.title %} @@ -64,5 +78,6 @@ This Template can also be used as the rendering template for Sections, eg: examp

{{ post.title }}{%- if not hide_section_dates %} - {%- endif %}

{%- endfor %} {%- endfor %} + {%- endif %} {%- endblock content %} diff --git a/templates/macros/head.html b/templates/macros/head.html index 25e981d..603c341 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -228,6 +228,10 @@ {%- endif %} + {%- if config.extra.favicon_svg %} + + {%- endif %} + {%- if config.extra.favicon180 %} {%- endif %} -- cgit v1.3.1