From 6c195035966d1b1d2cac50f9aacc3617b3a0e475 Mon Sep 17 00:00:00 2001
From: Jieiku
Date: Mon, 5 Aug 2024 18:07:12 -0700
Subject: simplify switching search library
---
templates/404.html | 2 +-
templates/archive.html | 2 +-
templates/base.html | 6 +++---
templates/categories/list.html | 2 +-
templates/categories/single.html | 2 +-
templates/index.html | 3 ++-
templates/macros/create_stork_toml.html | 15 ---------------
templates/macros/macros.html | 18 +++++++++---------
templates/partials/head.html | 4 ++--
templates/partials/head_js.html | 8 +++-----
templates/stork_toml.html | 9 ---------
templates/tags/list.html | 2 +-
templates/tags/single.html | 2 +-
13 files changed, 25 insertions(+), 50 deletions(-)
delete mode 100644 templates/macros/create_stork_toml.html
delete mode 100644 templates/stork_toml.html
(limited to 'templates')
diff --git a/templates/404.html b/templates/404.html
index fee5607..40fb731 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- block seo %}
{{ super() }}
diff --git a/templates/archive.html b/templates/archive.html
index 587d7ea..e078bdd 100644
--- a/templates/archive.html
+++ b/templates/archive.html
@@ -5,7 +5,7 @@ This Template can also be used as the rendering template for Sections, eg: examp
{% extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- block seo %}
{{- super() }}
diff --git a/templates/base.html b/templates/base.html
index 1604dbe..3096ac2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -5,7 +5,7 @@
{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
@@ -98,10 +98,10 @@
{%- endif %}
diff --git a/templates/categories/list.html b/templates/categories/list.html
index 506613c..b01b37f 100644
--- a/templates/categories/list.html
+++ b/templates/categories/list.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- block seo %}
{{- super() }}
diff --git a/templates/categories/single.html b/templates/categories/single.html
index be219aa..ba86397 100644
--- a/templates/categories/single.html
+++ b/templates/categories/single.html
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- block seo %}
{{- super() }}
diff --git a/templates/index.html b/templates/index.html
index 0b1e83f..802f328 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -5,7 +5,8 @@ This Template can also be used directly for the index eg: example.com/ or as the
{%- extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+
{%- block seo %}
{{- super() }}
diff --git a/templates/macros/create_stork_toml.html b/templates/macros/create_stork_toml.html
deleted file mode 100644
index ee1d765..0000000
--- a/templates/macros/create_stork_toml.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{%- macro from_section(section) -%}
-{%- set section = get_section(path=section) -%}
-{%- for post in section.pages -%}
-{%- if not post.draft %} {path = {{ '.' ~ post.path ~ 'index.html' | json_encode | safe }}, url = {{ post.permalink | json_encode | safe }}, title = {{ post.title | striptags | json_encode | safe }}}
-{%- set found = true -%}
-{%- if not loop.last -%},
-{% endif -%}
-{%- endif -%}
-{%- endfor -%}
-{%- if found and section.subsections -%},
-{% for subsection in section.subsections -%}
-{{ self::from_section(section=subsection) }}
-{%- endfor -%}
-{%- endif -%}
-{%- endmacro from_section -%}
diff --git a/templates/macros/macros.html b/templates/macros/macros.html
index dd3fcff..dd7b975 100644
--- a/templates/macros/macros.html
+++ b/templates/macros/macros.html
@@ -4,7 +4,7 @@
{%- macro page_listing(page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
@@ -13,7 +13,7 @@
{%- macro series_link(inner, page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- if inner.content == page.content %}
{{ inner.title }}
{% else %}
@@ -24,7 +24,7 @@
{%- macro title_post(page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- endmacro title_post %}
@@ -36,7 +36,7 @@
{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}