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 %} + +{%- 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 -#}