diff --git a/Gemfile b/Gemfile index 15b9258..e3d8d26 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem "jekyll", "~> 4.3.2" # installed by `gem jekyll` # gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2 -gem "just-the-docs", "0.8.0" # pinned to the current Release +gem "just-the-docs", "0.10.0" # pinned to the current Release # gem "just-the-docs" # always download the latest release gem 'jekyll-last-modified-at', '~> 1.1' # pinned to the current Release diff --git a/Gemfile.lock b/Gemfile.lock index 8ace60e..e5d7ae5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,7 +43,7 @@ GEM jekyll (>= 3.8, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - just-the-docs (0.8.0) + just-the-docs (0.10.0) jekyll (>= 3.8.5) jekyll-include-cache jekyll-seo-tag (>= 2.0) @@ -84,7 +84,7 @@ PLATFORMS DEPENDENCIES jekyll (~> 4.3.2) jekyll-last-modified-at (~> 1.1) - just-the-docs (= 0.8.0) + just-the-docs (= 0.10.0) BUNDLED WITH 2.3.26 diff --git a/_config.yml b/_config.yml index 70b3bae..3c2f74c 100644 --- a/_config.yml +++ b/_config.yml @@ -18,4 +18,7 @@ last-modified-at: date-format: '%d/%m/%Y' # Color Theme -color_scheme: light \ No newline at end of file +color_scheme: light + +# Show navigation error report +nav_error_report: true # default is false/nil. \ No newline at end of file diff --git a/_includes/components/breadcrumbs.html b/_includes/components/breadcrumbs.html new file mode 100644 index 0000000..7f37107 --- /dev/null +++ b/_includes/components/breadcrumbs.html @@ -0,0 +1,96 @@ +{%- comment -%} + Include as: {%- include components/breadcrumbs.html -%} + Depends on: page, site. + Includes: components/site_nav.html. + Results in: HTML for the breadcrumbs component. + Overwrites: + nav_list_link, site_nav, nav_list_simple, nav_list_link_class, nav_category, + nav_anchor_splits, nav_breadcrumbs, nav_split, nav_split_next, nav_split_test, + nav_breadcrumb_link, nav_list_end_less, nav_list_end_count, nav_end_index, nav_breadcrumb. +{%- endcomment -%} + +{%- if page.url != "/" and page.parent and page.title -%} + +{%- capture nav_list_link -%} + +{%- endcapture -%} + +{%- capture site_nav -%} +{%- include_cached components/site_nav.html all=true -%} +{%- endcapture -%} + +{%- capture nav_list_simple -%} +"s requires that number + of potential ancestors to be popped from the stack. + + The number of occurrences of a string in nav_split_next is computed by removing + them all, then dividing the resulting size difference by the length of the string. +{%- endcomment %} + +{%- assign nav_breadcrumbs = "" | split: "" -%} + +{%- for nav_split in nav_anchor_splits -%} +{%- unless forloop.last -%} + +{%- 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 -%} +{%- if nav_split_test == nav_split_next -%} + {%- assign nav_breadcrumb_link = + nav_split | split: "" | append: "" -%} + {%- assign nav_breadcrumbs = nav_breadcrumbs | push: nav_breadcrumb_link -%} +{%- endif -%} + +{%- if nav_split_next contains "" -%} + {%- assign nav_list_end_less = nav_split_next | remove: "" -%} + {%- assign nav_list_end_count = + nav_split_next.size | minus: nav_list_end_less.size | divided_by: 5 -%} + {% for nav_end_index in (1..nav_list_end_count) %} + {%- assign nav_breadcrumbs = nav_breadcrumbs | pop -%} + {%- endfor -%} +{%- endif -%} + +{%- endunless -%} +{%- endfor -%} + + + +{% if site.nav_error_report %} +{{ nav_error_report }} +{% endif %} + +{%- endif -%} \ No newline at end of file diff --git a/_includes/components/children_nav.html b/_includes/components/children_nav.html new file mode 100644 index 0000000..2a5cb8e --- /dev/null +++ b/_includes/components/children_nav.html @@ -0,0 +1,89 @@ +{%- comment -%} + Include as: {%- include components/children_nav.html -%} + Depends on: page, site, nav_breadcrumbs. + Results in: HTML for the children-navigation component. + Includes: components/nav/sorted.html, toc_heading_custom.html. + Overwrites: + nav_ancestor_links, nav_top_node_titles, nav_child_candidates, nav_children, + nav_child, nav_child_ok, nav_child_ancestor, nav_sorted. +{%- endcomment -%} + +{%- comment -%} + Whether a page has any children is checked efficiently by inspecting the cached + site_nav. If the page has no children, nav_children is set to an empty array; + otherwise nav_children is left unset. +{%- endcomment -%} + +{%- if page.has_children == false -%} + {%- assign nav_children = "" | split: "" -%} +{%- else -%} + + {%- assign nav_children = nil -%} + + {%- capture nav_list_link -%} + + {%- endcapture -%} + + {%- capture site_nav -%} + {%- include_cached components/site_nav.html all=true -%} + {%- endcapture -%} + + {%- capture nav_list_simple -%} +