From 15a0b6e91b687bc2a8fdf8345c8e1cc3baa7b2d8 Mon Sep 17 00:00:00 2001 From: Jos Ahrens Date: Wed, 6 Mar 2024 23:39:45 +0100 Subject: [PATCH] Fix Liquid filter typo in breadcrumb component (`strip` instead of `trim`) (#1434) We are running into an issue upgrading from 0.7 to 0.8, suggesting that `trim` is not a method. ``` 1.963 Liquid Exception: Liquid error (/usr/gem/gems/just-the-docs-0.8.0/_includes/components/breadcrumbs.html line 59): undefined filter trim included in /_layouts/default.html 1.968 /usr/gem/gems/liquid-4.0.4/lib/liquid/strainer.rb:58:in `invoke': Liquid error (/usr/gem/gems/just-the-docs-0.8.0/_includes/components/breadcrumbs.html line 59): undefined filter trim included (Liquid::UndefinedFilter) ``` Looking at the liquid docs, we're probably looking for `strip` and not `trim` https://shopify.github.io/liquid/filters/strip/ https://github.com/Shopify/liquid/blob/main/History.md#300--2014-11-12, I don't see a trim so it may have been an extension? This does work normally on just-the-docs itself running from scratch, so it might also be a bug in our application (or combination of different versions in plugins). --- CHANGELOG.md | 10 +++++++++- _includes/components/breadcrumbs.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c23f80f..45d376e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,12 +17,20 @@ This website is built from the `HEAD` of the `main` branch of the theme reposito Code changes to `main` that are *not* in the latest release: -- N/A +- Fixed: Liquid filter typo in breadcrumb component (`strip` instead of `trim`) by [@Zarthus] in [#1434] Docs changes made since the latest release: - N/A +### New Contributors + +- [@Zarthus] made their first contribution in [#1434] + +[@Zarthus]: https://github.com/Zarthus + +[#1434]: https://github.com/just-the-docs/just-the-docs/pull/1434 + ## Release v0.8.0 Hi folks! This first minor release of 2024 has a short number of changes: a large improvement of build times for large sites, a new keyboard shortcut to focus the search bar, and sidebar navigation bugfixes for "pretty" URLs (with `.html` omitted) and the clickable area on Safari. This release has no explicit breaking changes and should be a straightforward upgrade for most (if not all) users. diff --git a/_includes/components/breadcrumbs.html b/_includes/components/breadcrumbs.html index 2be747b..8668791 100644 --- a/_includes/components/breadcrumbs.html +++ b/_includes/components/breadcrumbs.html @@ -56,7 +56,7 @@ {%- for nav_split in nav_anchor_splits -%} {%- unless forloop.last -%} - {%- assign nav_split_next = nav_anchor_splits[forloop.index] | trim -%} + {%- assign nav_split_next = nav_anchor_splits[forloop.index] | strip -%} {%- assign nav_split_test = nav_split_next | remove_first: nav_list_simple | prepend: nav_list_simple -%}