aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJieiku2022-08-23 13:41:41 -0700
committerJieiku2022-08-23 13:41:41 -0700
commitc7b914505b6505b013610cc71e3b50d68c4a5473 (patch)
treed2abebfa75cedd1b7351b51f9d5c909834e8d05d /templates
parent6e6c0cbbb5d6136788d35ee5a354d36079c3475a (diff)
downloadabridge-c7b914505b6505b013610cc71e3b50d68c4a5473.tar.gz
abridge-c7b914505b6505b013610cc71e3b50d68c4a5473.tar.bz2
abridge-c7b914505b6505b013610cc71e3b50d68c4a5473.zip
Optimizations, Update Readme YellowLabTools
Diffstat (limited to 'templates')
-rw-r--r--templates/404.html2
-rw-r--r--templates/base.html16
-rw-r--r--templates/categories/list.html2
-rw-r--r--templates/categories/single.html2
-rw-r--r--templates/contact.html2
-rw-r--r--templates/index.html12
-rw-r--r--templates/macros/create_stork_toml.html5
-rw-r--r--templates/macros/head.html16
-rw-r--r--templates/macros/macros.html10
-rw-r--r--templates/macros/page.html2
-rw-r--r--templates/macros/social.html6
-rw-r--r--templates/page.html8
-rw-r--r--templates/pages.html2
-rw-r--r--templates/posts.html2
-rw-r--r--templates/stork_toml.html5
-rw-r--r--templates/tags/list.html2
-rw-r--r--templates/tags/single.html2
-rw-r--r--templates/tinysearch_json.html5
18 files changed, 51 insertions, 50 deletions
diff --git a/templates/404.html b/templates/404.html
index f72c54f..02c7688 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -12,7 +12,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_404=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_404=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/base.html b/templates/base.html
index 9d27f8a..81dd59a 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -5,15 +5,15 @@
<!DOCTYPE html>
<html lang="{{ config.extra.language_code | default(value='en-US') }}">
<head>
- {{- macros_head::theme() }}
- {{- macros_head::stylesheets() }}
+ {{- macros_head::theme(config=config) }}
+ {{- macros_head::stylesheets(config=config) }}
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
- {{- macros_head::stylesheets_preload() }}
- {{- macros_head::js() }}
+ {{- macros_head::stylesheets_preload(config=config) }}
+ {{- macros_head::js(config=config) }}
<meta name="base" content="{{ config.base_url | safe }}" />
- {{- macros_head::feed() }}
+ {{- macros_head::feed(config=config) }}
{%- block seo %}
{%- if config.extra.title_separator %}
{%- set title_separator = " " ~ config.extra.title_separator ~ " " -%}
@@ -25,8 +25,8 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
- {{- macros_head::security() }}
- {{- macros_head::favicons() }}
+ {{- macros_head::security(config=config) }}
+ {{- macros_head::favicons(config=config) }}
{%- if config.build_search_index %}
<noscript><link rel="stylesheet" href="{{ get_url(path='nojs.css', trailing_slash=false) | safe }}" /></noscript>
{%- endif %}
@@ -91,7 +91,7 @@
<hr />
{%- endif %}
<div class="c">
- {{- social_macros::social_links(social_config=config.extra.social) }}
+ {{- social_macros::social_links(social_config=config.extra.social, config=config) }}
{#- Copyright START #}
{%- set copyright_start_year=config.extra.copyright_start_year | default(value="") %}
diff --git a/templates/categories/list.html b/templates/categories/list.html
index 2c70142..1ded228 100644
--- a/templates/categories/list.html
+++ b/templates/categories/list.html
@@ -12,7 +12,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/categories/single.html b/templates/categories/single.html
index b1cd680..1f5e48c 100644
--- a/templates/categories/single.html
+++ b/templates/categories/single.html
@@ -12,7 +12,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/contact.html b/templates/contact.html
index ae8a262..526bb61 100644
--- a/templates/contact.html
+++ b/templates/contact.html
@@ -21,7 +21,7 @@
{%- set description = config.description %}
{%- endif %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/index.html b/templates/index.html
index 1434aee..7c8c45a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,7 +19,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
@@ -28,10 +28,10 @@
<div>
{%- for page in paginator.pages %}
<article>
- {{- macros::title_index(page=page) }}
+ {{- macros::title_index(page=page, config=config) }}
{%- if config.extra.meta_index.position %}
{%- if config.extra.meta_index.position == "top" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page) }}
+ {{- macros::meta_index(page=page, config=config) }}
{%- endif %}{%- endif %}
<div class="sum">
<p>
@@ -47,12 +47,12 @@
</div>
{%- if config.extra.meta_index.position %}
{%- if config.extra.meta_index.position == "bottom" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page) }}
+ {{- macros::meta_index(page=page, config=config) }}
{%- endif %}
{%- endif %}
</article>
{%- endfor %}
- {{- macros::pagination(paginator=paginator) }}
+ {{- macros::pagination(paginator=paginator, config=config) }}
</div>
{%- set section_item = get_section(path="_index.md") %}
{%- if config.extra.recent | default(value=true) %}
@@ -60,7 +60,7 @@
<div class="toc-sticky">
<h1><span class="s75">Recent Posts</span></h1>
{%- for page in section_item.pages | slice(end=config.extra.recent_items) %}
- {{- page_macros::page_listing(page=page) }}
+ {{- page_macros::page_listing(page=page, config=config) }}
{%- endfor %}
</div>
</div>
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 %}
<script src="{{ get_url(path=config.extra.js_theme, trailing_slash=false) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_theme, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
@@ -7,7 +7,7 @@
{%- endif %}
{%- endmacro %}
-{%- macro stylesheets() %}
+{%- macro stylesheets(config) %}
{%- if config.extra.stylesheets %}{%- for i in config.extra.stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=i, trailing_slash=false, cachebust=true) | safe }}" />
@@ -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 %}
<link rel="alternate" type="{% if config.feed_filename is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="Atom/RSS Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" />
{%- 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 %}
<meta name="theme-color" content="{{ config.extra.favicon_theme_color }}" />
{%- endif %}
@@ -260,7 +260,7 @@
-{%- macro security() %}
+{%- macro security(config) %}
{%- if config.extra.security_header_referrer %}
<meta name="referrer" content="{{ config.extra.security_header_referrer | safe }}" />
{%- 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 -%}
<meta name="robots" content="noindex, follow" />
{%- 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) %}
<h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1>
{%- endmacro title_post %}
-{%- macro meta_post(page) %}
+{%- macro meta_post(page, config) %}
<span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}>
{#- Author #}
@@ -42,12 +42,12 @@
{%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span>
{%- endmacro meta_post %}
-{%- macro title_index(page) %}
+{%- macro title_index(page, config) %}
<h1>{% if config.extra.title_size_index %}<span class="{{ config.extra.title_size_index }}">{% endif %}<a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a>{% if config.extra.title_size_index %}</span>{% endif %}</h1>
{%- endmacro title_index %}
-{%- macro meta_index(page) %}
+{%- macro meta_index(page, config) %}
<span{%- if config.extra.meta_index.size %} class="{{ config.extra.meta_index.size }}"{% endif %}>
{#- 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) %}
<div class="toc-item">
<a href="{{ page.permalink | safe}}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a>
</div>
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) %}
<nav>
<ul>
{%- set base_url = get_url(path="", lang=lang) -%}
@@ -6,8 +6,8 @@
<li><a href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" target="_blank" title="Atom/RSS Feed"><i type="Button" class="svg rss" title="Atom/RSS Feed"></i></a></li>{% endif -%}{% endif -%}
{%- if social_config.mail -%}
{%- if social_config.mail_encode -%}
- {%- set base64_email = "abridge" ~ social_config.mail -%}
- <li class="js"><a class="m-protected" href="#" target="_blank" title="{{ base64_email | base64_encode }}"><i type="Button" class="svg mail" title="Mail"></i></a></li>
+ {%- set base64_email = social_config.mail -%}
+ <li class="js"><a class="m-protected" href="#{{ base64_email | base64_encode }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li>
{%- else -%}
<li><a href="mailto:{{ social_config.mail }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li>
{%- endif -%}
diff --git a/templates/page.html b/templates/page.html
index 2b8c6f9..203959a 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -27,23 +27,23 @@
{%- set page_section = "" %}
{%- endif %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }}
{%- endblock seo %}
{%- block content %}
<article>
- {{- macros::title_post(page=page) }}
+ {{- macros::title_post(page=page, config=config) }}
{%- if config.extra.meta_post.position %}
{%- if config.extra.meta_post.position == "top" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page) }}
+ {{- macros::meta_post(page=page, config=config) }}
{%- endif %}{%- endif %}
{{ page.content | safe }}
{%- if config.extra.meta_post.position %}
{%- if config.extra.meta_post.position == "bottom" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page) }}
+ {{- macros::meta_post(page=page, config=config) }}
{%- endif %}{%- endif %}
{%- block page_footer %}
diff --git a/templates/pages.html b/templates/pages.html
index 38dfd7f..87c9adb 100644
--- a/templates/pages.html
+++ b/templates/pages.html
@@ -21,7 +21,7 @@
{%- set description = config.description %}
{%- endif %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/posts.html b/templates/posts.html
index a03130c..d4fc9e4 100644
--- a/templates/posts.html
+++ b/templates/posts.html
@@ -14,7 +14,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/stork_toml.html b/templates/stork_toml.html
index ba3f714..816fcd4 100644
--- a/templates/stork_toml.html
+++ b/templates/stork_toml.html
@@ -1,6 +1,9 @@
{%- import "macros/create_stork_toml.html" as create_stork_toml -%}
+
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "stork" %}
[input]
base_directory = "public"
files = [
-{{ create_stork_toml::from_section(section="_index.md") }}
+{{ create_stork_toml::from_section(section="_index.md", config=config) }}
]
+{%- endif %}{%- endif %} \ No newline at end of file
diff --git a/templates/tags/list.html b/templates/tags/list.html
index 53f492f..545bf34 100644
--- a/templates/tags/list.html
+++ b/templates/tags/list.html
@@ -12,7 +12,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/tags/single.html b/templates/tags/single.html
index 62b7931..ad8caeb 100644
--- a/templates/tags/single.html
+++ b/templates/tags/single.html
@@ -12,7 +12,7 @@
{%- set description = config.description %}
- {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+ {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
diff --git a/templates/tinysearch_json.html b/templates/tinysearch_json.html
index 638833f..37f83a1 100644
--- a/templates/tinysearch_json.html
+++ b/templates/tinysearch_json.html
@@ -1,2 +1,5 @@
{%- import "macros/create_tinysearch_json.html" as create_tinysearch_json -%}
-[{{ create_tinysearch_json::from_section(section="_index.md") }}] \ No newline at end of file
+
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "tinysearch" %}
+[{{ create_tinysearch_json::from_section(section="_index.md", config=config) }}]
+{%- endif %}{%- endif %} \ No newline at end of file