[x] Find references that deal with solving the problem
[x] Study references. Apply new solutions until find a method that works
[x] Clean up the code
[x] push new version, trigger HC for testing
[x] close issue after test passed
How the breadcrumb works now
Each Article has a YAML front matter with the breadcrumb attribute. It looks like this:
breadcrumb: system
My Liquid template is looping through all articles and generates the bread crumb.
site.pages contains the URL of each article. To access it:
{% for pages in site.pages %}
{{pages.url}}
{% endfor %}
This works fine, but has the following problems:
reordering the menu items requires to edit every front matter of every article and modify the order attribute
You have no place to see the structure of the book-bar.
The new way
To reduce maintenance workload we have removed the breadcrumb and order attribute in each articles front matter. The new idea is to read the menu attribute from the book-bar.yml file in order to generate the bread crumb.
Benefits
So now it is easier to create a new article.
Another huge benefit of the book-bar.yml file is that you can change the order of listed articles in the menu by only editing this file. Instead if keep the menu attribute and order attrribute in each article, you would need to modify each article.
The book-bar.yml file also shows the article hierarchy of the respective board. This is often useful during creation of articles or for documentation purposes
How the breadcrumb works now
Each Article has a YAML front matter with the breadcrumb attribute. It looks like this:
My Liquid template is looping through all articles and generates the bread crumb.
site.pages contains the URL of each article. To access it:
This works fine, but has the following problems:
The new way
To reduce maintenance workload we have removed the breadcrumb and order attribute in each articles front matter. The new idea is to read the menu attribute from the book-bar.yml file in order to generate the bread crumb.
Benefits
Generating the Bread Crumb
two step procedure
Problem to solve
Nested for loops did not work
References
Related Issues