aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJieiku2023-05-22 22:37:44 -0700
committerJieiku2023-05-22 22:37:44 -0700
commit6dcec618d0ff0a2270f787f62267a0622275c69d (patch)
treef0dd674fe43331db55ddae38808749de0323f030 /templates
parent71d977d49afbf93e0c736815e36d59664991fa18 (diff)
downloadabridge-6dcec618d0ff0a2270f787f62267a0622275c69d.tar.gz
abridge-6dcec618d0ff0a2270f787f62267a0622275c69d.tar.bz2
abridge-6dcec618d0ff0a2270f787f62267a0622275c69d.zip
Load Tinysearch/Stork On Demand
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html6
-rw-r--r--templates/macros/create_tinysearch_json.html2
-rw-r--r--templates/macros/head.html44
-rw-r--r--templates/robots.txt5
4 files changed, 11 insertions, 46 deletions
diff --git a/templates/base.html b/templates/base.html
index 642239b..a1e4918 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -51,14 +51,14 @@
</div>
<div>
<ul>
- {%- set js_theme=config.extra.js_theme | default(value=true) -%}
- {%- if config.extra.menu or js_theme %}
+ {%- set js_switcher=config.extra.js_switcher | default(value=true) -%}
+ {%- if config.extra.menu or js_switcher %}
{%- if config.extra.menu %}
{%- for i in config.extra.menu -%}
<li> <h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{{ i.name | safe }}</a></h2> </li>
{%- endfor -%}
{%- endif -%}
- {%- if js_theme -%}
+ {%- if js_switcher -%}
{%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%}
<li class="js">{%- if icon_adjust -%}<i type="reset" id="mode" class="{{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="mode">&#9728;</i>{%- endif -%}</li>
{%- endif -%}
diff --git a/templates/macros/create_tinysearch_json.html b/templates/macros/create_tinysearch_json.html
index a28d9dc..0e6ece4 100644
--- a/templates/macros/create_tinysearch_json.html
+++ b/templates/macros/create_tinysearch_json.html
@@ -24,4 +24,4 @@
{{ self::from_section(section=subsection) }}
{%- endfor -%}
{%- endif -%}{%- endif -%}
-{%- endmacro from_section -%} \ No newline at end of file
+{%- endmacro from_section -%}
diff --git a/templates/macros/head.html b/templates/macros/head.html
index 3767a16..8da09cb 100644
--- a/templates/macros/head.html
+++ b/templates/macros/head.html
@@ -56,19 +56,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
{%- macro js(config) %}
{%- set search_library=config.extra.search_library | default(value="elasticlunr") -%}
@@ -129,7 +116,7 @@
{%- if search_library == "tinysearch" %}
<script defer type="module" src="{{ get_url(path='tinysearch.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='tinysearch.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- elif search_library == "stork" %}
- <script defer type="module" src="{{ get_url(path='stork.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='stork.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
+ <script defer type="module" src="{{ get_url(path='search_stork.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='search_stork.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- else %}
<script defer src="{{ get_url(path='elasticlunr.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='elasticlunr.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
<script defer src="{{ get_url(path='search.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='search.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
@@ -166,7 +153,7 @@
{%- endif %}{%- endif %}
{%- if config.extra.math_auto_render or page.extra.math_auto_render %}
- {%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="auto-render.min.js") -%}
+ {%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="katex-auto-render.min.js") -%}
{%- if katex_autorender_js %}
{%- if katex_autorender_js is matching("^http[s]?://") %}
<script defer src="{{ katex_autorender_js | safe }}"{%- if config.extra.integrity | default(value=true) and config.extra.katex_autorender_js_integrity %} integrity="{{ config.extra.katex_autorender_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
@@ -187,33 +174,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{%- macro favicons(config) %}
{%- if config.extra.favicon_theme_color %}
<meta name="theme-color" content="{{ config.extra.favicon_theme_color }}" />
diff --git a/templates/robots.txt b/templates/robots.txt
index 766e67f..09aba30 100644
--- a/templates/robots.txt
+++ b/templates/robots.txt
@@ -1,4 +1,9 @@
+{%- if config.extra.prod %}
Sitemap: {{ get_url(path="sitemap.xml", trailing_slash=false) }}
User-Agent: *
Allow: /
Host: {{ get_url(path="/", trailing_slash=false) }}
+{%- else %}
+User-Agent: *
+Disallow: /
+{%- endif %}