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/macros/head.html | 198 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 templates/macros/head.html (limited to 'templates/macros/head.html') diff --git a/templates/macros/head.html b/templates/macros/head.html new file mode 100644 index 0000000..bea8f66 --- /dev/null +++ b/templates/macros/head.html @@ -0,0 +1,198 @@ +{%- macro stylesheet() %} + +{%- endmacro %} + + +{%- macro resource() %} +{%- if config.extra.fonts_load and config.extra.fonts %}{%- for i in config.extra.fonts %} + {%- if i.url is matching("^http[s]?://") %} + + {%- else %} + + {%- endif %} +{%- endfor %}{%- endif %} + +{%- if config.build_search_index %} + + +{%- endif %} + +{%- if config.generate_feed %} + +{%- endif %} + +{%- endmacro %} + + +{%- macro favicons() %} + {%- if config.extra.favicon_theme_color %} + + {%- endif %} + + {%- if config.extra.favicon_ms_color %} + + {%- endif %} + + {%- if config.extra.favicon_webmanifest %} + + {%- endif %} + + {%- if config.extra.favicon_mask and config.extra.favicon_mask_color %} + + {%- endif %} + + {%- if config.extra.favicon180 %} + + {%- endif %} + + {%- if config.extra.favicon32 %} + + {%- endif %} + + {%- if config.extra.favicon16 %} + + {%- endif %} +{%- endmacro %} + + +{#- type: website or article, generally setting article for blog articles -#} +{#- page_images: using for the blog single template page -#} +{#- page_section: the blog single template page have to pass the parameter -#} +{#- is_404: using for the 404.html template -#} +{%- macro seo( title="",title_addition="",description="",type="website",is_home=false,is_404=false,is_page=false,page_images="",page_section="",created_time="2021-05-01T08:08:00+08:00", updated_time="2021-05-01T08:08:08+08:00" ) %} +{%- if is_404 -%} + +{%- else -%} + + + +{%- endif -%} + +{%- if current_url %} + {%- set page_url = current_url %} +{%- else %} + {%- set page_url = get_url(path="404.html", trailing_slash=true) %} +{%- endif %} + {{ title ~ title_addition }} + +{%- if config.extra.author %} + +{%- endif %} +{%- if config.extra.facebook_publisher %} + +{%- endif %} + +{%- if config.extra.facebook_author %} + +{%- endif %} +{%- if page.description %} + +{%- else %} + +{%- endif %} + +{%- if page.extra.keywords %} + +{%- else %} + +{%- endif %} + +{#- Extra SEO START #} +{%- if config.extra.seo | default(value=true) %} +{%- if not is_404 %} + +{%- if config.extra.google %} + +{%- endif %} + +{%- if config.extra.bing %} + +{%- endif %} + + + +{%- if page.description %} + + +{%- else %} + + +{%- endif %} + +{%- if page.title %} + + +{%- else %} + + +{%- endif %} + + +{#- SEO MEDIA START #} +{%- if page.extra.thumbnail %} + + + + +{%- elif page.extra.static_thumbnail %} + + {%- if page.extra.static_thumbnail is matching("^http[s]?://") %} + + + {%- else %} + + + {%- endif %} + +{%- elif config.extra.banner %} + + + + +{%- else %} + + +{%- endif %} + +{%- if config.extra.open.audio %} + +{%- endif %} + +{%- if config.extra.open.locale %} + +{%- endif %} + +{%- if config.extra.open.videos %} + {%- for video in config.extra.open.videos %} + + {%- endfor %} +{%- endif %} + +{#- SEO MEDIA END #} + + + + + +{%- if config.extra.social.twitter %} + + +{%- endif %} + + + +{%- endif %} +{%- endif %} +{#- Extra SEO END #} +{%- endmacro %} + +{%- macro math() %} + {%- if config.extra.katex_enabled %} + + + + {%- if config.extra.katex_auto_render %} + + {%- endif %} + {%- endif %} +{%- endmacro %} -- cgit v1.3.1