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/macros/create_stork_toml.html | 15 --------------- templates/macros/macros.html | 18 +++++++++--------- 2 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 templates/macros/create_stork_toml.html (limited to 'templates/macros') 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 %}