From 6dcec618d0ff0a2270f787f62267a0622275c69d Mon Sep 17 00:00:00 2001
From: Jieiku
Date: Mon, 22 May 2023 22:37:44 -0700
Subject: Load Tinysearch/Stork On Demand
---
templates/base.html | 6 ++--
templates/macros/create_tinysearch_json.html | 2 +-
templates/macros/head.html | 44 ++--------------------------
templates/robots.txt | 5 ++++
4 files changed, 11 insertions(+), 46 deletions(-)
(limited to 'templates')
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 @@
- {%- 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 -%}
-
{%- endfor -%}
{%- endif -%}
- {%- if js_theme -%}
+ {%- if js_switcher -%}
{%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%}
- {%- if icon_adjust -%}{%- else -%}☀{%- endif -%}
{%- 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" %}
{%- elif search_library == "stork" %}
-
+
{%- else %}
@@ -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]?://") %}
@@ -187,33 +174,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{%- macro favicons(config) %}
{%- if 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 %}
--
cgit v1.3.1