From c7b914505b6505b013610cc71e3b50d68c4a5473 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 23 Aug 2022 13:41:41 -0700 Subject: Optimizations, Update Readme YellowLabTools --- templates/macros/create_stork_toml.html | 5 ----- templates/macros/head.html | 16 ++++++++-------- templates/macros/macros.html | 10 +++++----- templates/macros/page.html | 2 +- templates/macros/social.html | 6 +++--- 5 files changed, 17 insertions(+), 22 deletions(-) (limited to 'templates/macros') diff --git a/templates/macros/create_stork_toml.html b/templates/macros/create_stork_toml.html index c9ed35c..642b3f9 100644 --- a/templates/macros/create_stork_toml.html +++ b/templates/macros/create_stork_toml.html @@ -1,8 +1,3 @@ -{# cargo install stork-search --locked #} -{# cd .dev/abridge #} -{# zola build #} -{# /home/jieiku/.cargo/bin/stork build --input public/data_stork/index.html --output static/stork.st #} - {%- macro from_section(section) -%} {%- set section = get_section(path=section) -%} {%- for post in section.pages -%} diff --git a/templates/macros/head.html b/templates/macros/head.html index c3b217c..92b2bb5 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -1,5 +1,5 @@ {#- Theme Switcher Button to toggle between dark/light #} -{%- macro theme() %} +{%- macro theme(config) %} {%- if config.extra.js_theme %} {%- if config.extra.js_themeButton or config.extra.js_bundle %} @@ -7,7 +7,7 @@ {%- endif %} {%- endmacro %} -{%- macro stylesheets() %} +{%- macro stylesheets(config) %} {%- if config.extra.stylesheets %}{%- for i in config.extra.stylesheets %} @@ -15,7 +15,7 @@ {%- endmacro %} -{%- macro stylesheets_preload() %} +{%- macro stylesheets_preload(config) %} {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} {%- if i.url is matching("^http[s]?://") %} @@ -43,7 +43,7 @@ -{%- macro feed() %} +{%- macro feed(config) %} {%- if config.generate_feed %} {%- endif %} @@ -51,7 +51,7 @@ -{%- macro js() %} +{%- macro js(config) %} {%- set preStyle = false %} @@ -228,7 +228,7 @@ -{%- macro favicons() %} +{%- macro favicons(config) %} {%- if config.extra.favicon_theme_color %} {%- endif %} @@ -260,7 +260,7 @@ -{%- macro security() %} +{%- macro security(config) %} {%- if config.extra.security_header_referrer %} {%- endif %} @@ -275,7 +275,7 @@ {#- 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-07-04T07:07:00-07:00", updated_time="2021-07-04T07:07:00-07:00" ) %} +{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2021-07-04T07:07:00-07:00", updated_time="2021-07-04T07:07:00-07:00" ) %} {%- if is_404 -%} {%- else -%} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 97b481f..dd3b75c 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,8 +1,8 @@ -{%- macro title_post(page) %} +{%- macro title_post(page, config) %}

{{ page.title }}

{%- endmacro title_post %} -{%- macro meta_post(page) %} +{%- macro meta_post(page, config) %} {#- Author #} @@ -42,12 +42,12 @@ {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- endmacro meta_post %} -{%- macro title_index(page) %} +{%- macro title_index(page, config) %}

{% if config.extra.title_size_index %}{% endif %}{{ page.title }}{% if config.extra.title_size_index %}{% endif %}

{%- endmacro title_index %} -{%- macro meta_index(page) %} +{%- macro meta_index(page, config) %} {#- Author #} @@ -99,7 +99,7 @@ {%- endmacro footer %} -{%- macro pagination(paginator)%} +{%- macro pagination(paginator, config)%} {%- if paginator.number_pagers > 1 %} {%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #} {%- set start = 1 %} diff --git a/templates/macros/page.html b/templates/macros/page.html index df06117..7fd0f77 100644 --- a/templates/macros/page.html +++ b/templates/macros/page.html @@ -1,4 +1,4 @@ -{%- macro page_listing(page) %} +{%- macro page_listing(page, config) %} diff --git a/templates/macros/social.html b/templates/macros/social.html index 0c704bf..52fb6ff 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,4 +1,4 @@ -{%- macro social_links(social_config) %} +{%- macro social_links(social_config, config) %}