diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/404.html | 2 | ||||
| -rw-r--r-- | templates/archive.html | 2 | ||||
| -rw-r--r-- | templates/base.html | 6 | ||||
| -rw-r--r-- | templates/categories/list.html | 2 | ||||
| -rw-r--r-- | templates/categories/single.html | 2 | ||||
| -rw-r--r-- | templates/index.html | 3 | ||||
| -rw-r--r-- | templates/macros/create_stork_toml.html | 15 | ||||
| -rw-r--r-- | templates/macros/macros.html | 18 | ||||
| -rw-r--r-- | templates/partials/head.html | 4 | ||||
| -rw-r--r-- | templates/partials/head_js.html | 8 | ||||
| -rw-r--r-- | templates/stork_toml.html | 9 | ||||
| -rw-r--r-- | templates/tags/list.html | 2 | ||||
| -rw-r--r-- | templates/tags/single.html | 2 |
13 files changed, 25 insertions, 50 deletions
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 %} <!DOCTYPE html> <html lang="{%- if lang != config.default_language %}{{ lang }}{% else %}{{ config.extra.language_code | default(value=lang) }}{% endif %}"> <head> @@ -98,10 +98,10 @@ <div> <form autocomplete=off class="js" name="goSearch" id="searchbox"> <div class="searchd"> - <input id="searchinput" type="text" placeholder="{{ macros::translate(key="Search", default="Search", i18n=i18n) }}" title="Search"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork" {% endif %}{% endif %} /> + <input id="searchinput" type="text" placeholder="{{ macros::translate(key="Search", default="Search", i18n=i18n) }}" title="Search" /> <button type="submit" title="Search" class="{%- if icon_search -%}{{ icon_search }}{%- else -%}si{%- endif -%}">{%- if not icon_search -%}⌕{%- endif -%}</button> </div> - <div class="results"><div id="suggestions"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork-output" {% endif %}{% endif %}></div></div> + <div class="results"><div id="suggestions"></div></div> </form> </div> {%- 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 %} <div class="tpad"> <a href="{{ page.permalink | safe}}{%- if uglyurls %}index.html{%- endif %}">{{ page.title }}</a> </div> @@ -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 %} <li><a class="scur" href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a></li> {% 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 %} <h1><a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> {%- 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 %} <span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}> {#- Author #} @@ -99,7 +99,7 @@ {%- macro title_index(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 %} <h1>{% if config.extra.title_size_index %}<span class="{{ config.extra.title_size_index }}">{% endif %}<a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ page.title }}</a>{% if config.extra.title_size_index %}</span>{% endif %}</h1> {%- endmacro title_index %} @@ -110,7 +110,7 @@ {%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} {%- 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 %} <span{%- if config.extra.meta_index.size %} class="{{ config.extra.meta_index.size }}"{% endif %}> {#- Author #} @@ -173,7 +173,7 @@ {%- macro footer(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 %} {#- prev/next content page nextprev title pagination #} {%- if not config.extra.hide_page_nextprev_titles | default(value=false) %} {%- if page.lower or page.higher %} @@ -197,7 +197,7 @@ {%- macro pagination(paginator, 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 paginator.number_pagers > 1 %} {%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #} {%- set start = 1 %} @@ -304,7 +304,7 @@ {%- macro numpagination(paginator, 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 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/partials/head.html b/templates/partials/head.html index 98d2382..1b95cc8 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -1,7 +1,7 @@ {#- Theme Switcher Button to toggle between dark/light #} {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %} {%- if config.extra.js_switcher | default(value=true) %} {%- set js_theme="js/theme.min.js" %} @@ -90,7 +90,7 @@ {#- Style Sheets Preload #} {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %} {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} {%- if i.url is matching("^http[s]?://") %} diff --git a/templates/partials/head_js.html b/templates/partials/head_js.html index 33088ec..2a16b6d 100644 --- a/templates/partials/head_js.html +++ b/templates/partials/head_js.html @@ -1,6 +1,6 @@ {#- JAVASCRIPT #} {%- set integrity = config.extra.integrity | default(value=true) -%} - {%- if config.extra.offline %}{% set integrity = false %}{% endif %} + {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %} {%- set search_library=config.extra.search_library | default(value="elasticlunr") -%} {%- set preStyle = false %} @@ -75,8 +75,6 @@ {%- if search_library == "tinysearch" %} <script defer type="module" src="{{ get_url(path='js/tinysearch.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/tinysearch.js' , sha_type=384, base64=true) | safe }}"{%- endif %}></script> - {%- elif search_library == "stork" %} - <script defer type="module" src="{{ get_url(path='js/search_stork.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/search_stork.min.js' , sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- elif config.build_search_index %} {%- set search_index_format="elasticlunr_json" -%} @@ -87,7 +85,7 @@ {%- 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 %} {%- if search_index_format == "elasticlunr_javascript" %}{#- Javascript index format #} <script defer src="{{ get_url(path='js/elasticlunr.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/elasticlunr.min.js' , sha_type=384, base64=true) | safe }}"{%- endif %}></script> <script defer src="{{ get_url(path='search_index.' ~ lang ~ '.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='search_index.' ~ lang ~ '.js' , sha_type=384, base64=true) | safe }}"{%- endif %}></script> @@ -163,4 +161,4 @@ -{#- End of head_js partial -#}
\ No newline at end of file +{#- End of head_js partial -#} diff --git a/templates/stork_toml.html b/templates/stork_toml.html deleted file mode 100644 index 816fcd4..0000000 --- a/templates/stork_toml.html +++ /dev/null @@ -1,9 +0,0 @@ -{%- 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", config=config) }} -] -{%- endif %}{%- endif %}
\ No newline at end of file diff --git a/templates/tags/list.html b/templates/tags/list.html index 8ed7b5c..5e7650f 100644 --- a/templates/tags/list.html +++ b/templates/tags/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/tags/single.html b/templates/tags/single.html index a57b1f7..723a47e 100644 --- a/templates/tags/single.html +++ b/templates/tags/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() }} |
