From 638ec9b8e220f8666d8b010e413c8709486028b7 Mon Sep 17 00:00:00 2001 From: Hofi Date: Fri, 24 May 2024 14:09:16 +0200 Subject: [PATCH] Liquid now can be used in page titles Signed-off-by: Hofi --- _data/navigation.yml | 2 +- _includes/breadcrumbs.html | 2 +- _includes/nav_list_add | 6 +++--- _includes/page__hero.html | 4 ++-- _includes/page_pagination.html | 10 +++++----- _includes/seo.html | 6 +++--- _includes/social-share.html | 2 +- _js/custom/navigation.js | 4 ---- _js/lunr/lunr-store.js | 4 ++-- _layouts/single.html | 4 ++-- .../02_Tools/01_Self_made_tools/01_Tests/README.md | 10 ++++++++-- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/_data/navigation.yml b/_data/navigation.yml index d87aed3b..20b9b662 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -1249,6 +1249,6 @@ doc-guide-nav: - title: "Self made helper tools" url: /doc-guide/02_Tools/01_Self_made_tools/README subnav: - - title: "Self made tools testing" + - title: "This's a self made tools testing page of {{ site.title }}" url: /doc-guide/02_Tools/01_Self_made_tools/01_Tests/README subnav: diff --git a/_includes/breadcrumbs.html b/_includes/breadcrumbs.html index 75c032a4..1cdcadf4 100644 --- a/_includes/breadcrumbs.html +++ b/_includes/breadcrumbs.html @@ -26,7 +26,7 @@ {{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }} {% endif %} {% if forloop.last %} -
  • {{ page.title }}
  • +
  • {{ page.title | liquify | markdownify | strip_html | strip_newlines }}
  • {% else %} {% assign i = i | plus: 1 %}
  • diff --git a/_includes/nav_list_add b/_includes/nav_list_add index 363811c0..94b43985 100644 --- a/_includes/nav_list_add +++ b/_includes/nav_list_add @@ -20,7 +20,7 @@ {% endif %} @@ -45,9 +45,9 @@ {% comment %} {% assign debugInfo = "NO subnav(" | append: nav.subnav | append: "), levelIndex: " | append: levelIndex | append: ", levelDepth: " | append: levelDepth | append: ", titleStyle: " | append: titleStyle %}
    {{ debugInfo }}
    {% endcomment %} {% if nav.url %} - {{ nav.title }} + {{ nav.title | liquify | markdownify | strip_html | strip_newlines }} {% else %} - {{ nav.title }} + {{ nav.title | liquify | markdownify | strip_html | strip_newlines }} {% endif %} {% endif %}
  • diff --git a/_includes/page__hero.html b/_includes/page__hero.html index dd1c26fb..32434b81 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -13,7 +13,7 @@ {% if page.header.image_description %} {% assign image_description = page.header.image_description %} {% else %} - {% assign image_description = page.title %} + {% assign image_description = page.title | liquify | markdownify | strip_html | strip_newlines %} {% endif %} {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} @@ -27,7 +27,7 @@

    {% if paginator and site.paginate_show_page_num %} {{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %} {% else %} - {{ page.title | default: site.title | markdownify | remove: "

    " | remove: "

    " }} + {{ page.title | default: site.title | liquify | markdownify | remove: "

    " | remove: "

    " }} {% endif %}

    {% if page.tagline %} diff --git a/_includes/page_pagination.html b/_includes/page_pagination.html index bd4a5b0f..15a4037c 100644 --- a/_includes/page_pagination.html +++ b/_includes/page_pagination.html @@ -14,17 +14,17 @@ {% assign prevurl = prev.url %} {% assign prevtitle = prev.title %} - {% comment %}
    prevtitle = {{ prevtitle }}
    {% endcomment %} + {% comment %}
    prevtitle = {{ prevtitle | liquify | markdownify | strip_html | strip_newlines }}
    {% endcomment %} {% endunless %} - {% comment %}
    pagetitle = {{ page.title }}
    {% endcomment %} + {% comment %}
    pagetitle = {{ page.title | liquify | markdownify | strip_html | strip_newlines }}
    {% endcomment %} {% unless forloop.last %} {% assign next = document[forloop.index] %} {% assign nexturl = next.url %} {% assign nexttitle = next.title %} - {% comment %}
    nexttitle = {{ nexttitle }}
    {% endcomment %} + {% comment %}
    nexttitle = {{ nexttitle | liquify | markdownify | strip_html | strip_newlines }}
    {% endcomment %} {% endunless %} {% endif %} @@ -45,7 +45,7 @@
    {{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}
    -
    {{ prevtitle | markdownify | strip_html }}
    +
    {{ prevtitle | liquify | markdownify | strip_html | strip_newlines }}
    @@ -60,7 +60,7 @@
    {{ site.data.ui-text[site.locale].pagination_next | default: "Next" }}
    -
    {{ nexttitle | markdownify | strip_html }}
    +
    {{ nexttitle | liquify | markdownify | strip_html | strip_newlines }}
    diff --git a/_includes/seo.html b/_includes/seo.html index c9d01e94..5761bd9b 100644 --- a/_includes/seo.html +++ b/_includes/seo.html @@ -7,7 +7,7 @@ {% assign title_separator = site.title_separator | default: '-' | replace: '|', '|' %} {%- if page.title -%} - {%- assign seo_title = page.title | append: " " | append: title_separator | append: " " | append: site.title -%} + {%- assign seo_title = page.title | liquify | markdownify | strip_html | strip_newlines | append: " " | append: title_separator | append: " " | append: site.title -%} {%- endif -%} {%- if seo_title -%} @@ -60,7 +60,7 @@ - + {% if seo_description %} @@ -75,7 +75,7 @@ {% if site.twitter.username %} - + diff --git a/_includes/social-share.html b/_includes/social-share.html index 0b377982..f9182cb3 100644 --- a/_includes/social-share.html +++ b/_includes/social-share.html @@ -3,7 +3,7 @@ {% endif %} - + diff --git a/_js/custom/navigation.js b/_js/custom/navigation.js index aa3a9924..2846a13c 100644 --- a/_js/custom/navigation.js +++ b/_js/custom/navigation.js @@ -782,10 +782,6 @@ $(function () { input.trigger("select"); }, 100); } - // else { - // // set focus back via the initial content otherwise the focus will not get back to the search input once again - // $(".initial-content").find("input").focus(); - // } if (tooltipTarget) hideTooltip(true); diff --git a/_js/lunr/lunr-store.js b/_js/lunr/lunr-store.js index 4b8b473d..99b5cbda 100644 --- a/_js/lunr/lunr-store.js +++ b/_js/lunr/lunr-store.js @@ -15,7 +15,7 @@ var store = [ {%- assign teaser = site.teaser -%} {%- endif -%} { - "title": {{ doc.title | jsonify }}, + "title": {{ doc.title | liquify | markdownify | strip_html | strip_newlines| jsonify }}, "excerpt": {%- if site.search_full_content == true -%} {{ doc.content | newline_to_br | @@ -54,7 +54,7 @@ var store = [ {%- assign l = true -%} {%- endif -%} { - "title": {{ doc.title | jsonify }}, + "title": {{ doc.title | liquify | markdownify | strip_html | strip_newlines| jsonify }}, "excerpt": {%- if site.search_full_content == true -%} {{ doc.content | newline_to_br | diff --git a/_layouts/single.html b/_layouts/single.html index 855cff47..d6eb6164 100644 --- a/_layouts/single.html +++ b/_layouts/single.html @@ -22,7 +22,7 @@ {% include sidebar.html %}