From 01601ef8f22f172b059be5fc263bf9b16b2ff88b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 22 Mar 2024 09:40:32 +0100 Subject: [PATCH] fix: add modified abridge templates Signed-off-by: Harald Hoyer --- templates/base.html | 185 +++++++++++++++++++++++++++++++++++ templates/partials/head.html | 118 ++++++++++++++++++++++ 2 files changed, 303 insertions(+) create mode 100644 templates/base.html create mode 100644 templates/partials/head.html diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..209a5bd --- /dev/null +++ b/templates/base.html @@ -0,0 +1,185 @@ +{%- import 'macros/seo.html' as macros_seo %} +{%- import "macros/macros.html" as macros %} +{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} +{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} +{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} + +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} + + + + {%- include "partials/head.html" %} + + {#- Rss / Atom Feed #} + {%- block rss %} + {%- if config.generate_feed %} + + {%- endif %} + + {%- endblock rss %} + + {#- SEO: title, description, etc #} + {%- block seo %} + {%- if config.extra.title_separator %} + {%- set title_separator = " " ~ config.extra.title_separator ~ " " -%} + {%- else %} + {%- set title_separator = " | " -%} + {%- endif %} + {%- endblock seo %} + + {%- block comments_init %} + {%- endblock comments_init %} + + {%- include "partials/head_js.html" %} + + +{%- block header %} +
+ + {%- if config.extra.sitedesc %} + {%- if config.description %} +
{{ config.description }}
+ {%- endif %} + {%- endif %} + {%- if config.extra.headhr %} +
+ {%- endif %} +
+{%- endblock header %} +
+ {%- block content %} + {%- endblock content %} +
+{%- block footer %} +
+ {%- if config.extra.foothr %} +
+ {%- endif %} +
+ {%- 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 %} + {%- set copyright_string = macros::translate(key='copyright_override', default='© $CURRENT_YEAR $SITE_TITLE', i18n=i18n) | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SITE_TITLE", to=config.title) %} + {% else %} + {%- set copyright_string = config.extra.copyright_override | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SITE_TITLE", to=config.title) %} + {% endif -%} + {%- else -%} + {%- set copyright_string = "© " ~ current_year ~ " " ~ config.title %} + {%- endif %} + {{ copyright_string | safe }}

+ {%- endif -%} + {#- Copyright END #} + + {%- if config.extra.menu_footer %} + + {%- endif %} + {%- if config.extra.footer_credit | default(value=true) %} + {%- if config.extra.footer_credit_override %} + {{ config.extra.footer_credit_override | safe }} + {%- else %} + {{ macros::translate(key="Powered_by", default="Powered by", i18n=i18n) }} Zola {{ macros::translate(key="and", default="and", i18n=i18n) }} Abridge

+ {%- endif %} + {%- endif %} +
+
+{%- endblock footer %} +{%- block gotop %} +{%- endblock gotop %} + + diff --git a/templates/partials/head.html b/templates/partials/head.html new file mode 100644 index 0000000..b3916d0 --- /dev/null +++ b/templates/partials/head.html @@ -0,0 +1,118 @@ + +{#- 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 %} + +{#- End of head partial -#}