From 30ea88e8d8c201c3fcce409a54712de820610dff Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 30 May 2022 23:20:43 -0700 Subject: Add Favicons, Add Head Macro, 404 noindex, config.toml Resources, Whitespace Cleanup --- templates/base.html | 238 +++++++++++++--------------------------------------- 1 file changed, 60 insertions(+), 178 deletions(-) (limited to 'templates/base.html') diff --git a/templates/base.html b/templates/base.html index e811e33..237bf41 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,158 +1,32 @@ -{% import "macros/social.html" as social_macros %} +{%- import 'macros/head.html' as macros_head %} +{%- import "macros/social.html" as social_macros %} +{%- import "macros/page.html" as page_macros %} +{%- import "macros/macros.html" as macros %} - + - + - - {% block title %}{% if page.title %}{{ page.title }} | {% endif %}{{ config.title }}{% endblock title %} - - {% if is_404 %} - - {% else %} - - - - {% endif %} - {% if current_url %} - {% set page_url = current_url %} - {% else %} - {% set page_url = get_url(path="404.html") %} - {% endif %} - {% if current_path %} - {% set page_path = current_path %} - {% else %} - {% set page_path = "/404.html" %} - {% endif %} - - {% block description %} - {% if page.description %} - - - {% if config.extra.seo | default(value=true) %} - - - {% endif %} - - {% else %} - - - {% if config.extra.seo | default(value=true) %} - - - {% endif %} - - {% endif %} - {% endblock description %} - - {% if page.extra.keywords %} - - {% else %} - - {% endif %} - - - - - {% if config.extra.google %}{% endif %} - {% if config.extra.bing %}{% endif %} + {{- macros_head::resource() }} + {{- macros_head::stylesheet() }} + {%- block seo %} + {%- if config.extra.title_separator %} + {%- set title_separator = " " ~ config.extra.title_separator ~ " " -%} + {%- else %} + {%- set title_separator = " | " -%} + {%- endif %} + {%- endblock seo %} + {{- macros_head::favicons() }} - - - {% block css %}{% endblock css %} - - {% if config.extra.favicon %} - - {% endif %} - - - {% if config.generate_feed %}{% endif %} - - {% if config.extra.seo | default(value=true) %} - {% block ogp_head %} - {% if page.title %} - - - {% else %} - - - {% endif %} - - - - - - {% endblock ogp_head %} - - {% block current_url %} - - - {% endblock current_url %} - - {% if config.extra.social.twitter %} - - - {% endif %} - - {% if page.extra.thumbnail %} - - - - {% elif page.extra.static_thumbnail %} - {%if page.extra.static_thumbnail is matching("^http[s]?://") %} - - - - {% else %} - - - - {% endif %} - {% elif config.extra.default_og_image %} - - - - {% elif config.extra.banner %} - - - - {% else %} - - {% endif %} - {% endif %} - - {% if config.extra.fonts_load %} - {% for i in config.extra.fonts %} - {% if 'http' in i.url %} - - {% else %} - - {% endif %} - {% endfor %} - {% endif %} - - {% if config.build_search_index %} - - - {% endif %} - - {% if config.extra.katex_enabled %} - - - - {% if config.extra.katex_auto_render %} - - {% endif %} - {% endif %} -{% block extra_head %}{% endblock extra_head %} + {{- macros_head::math() }} -{% block header %} +{%- block header %}
- {% if config.extra.sitedesc %} - {% if config.description %} -
{{ config.description }}
- {% endif %} - {% endif %} + {%- if config.extra.sitedesc %} + {%- if config.description %} +
{{ config.description }}
+ {%- endif %} + {%- endif %}
-{% endblock header %} -
-{% block content %} -{% endblock content %} -
-{% block footer %} +{%- endblock header %} +
+ {%- block content %} + {%- endblock content %} +
+{%- block footer %} -{% endblock footer %} +{%- endblock footer %} -- cgit v1.3.1