-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Just the docs v0.10.0 The following updates the core dependancy of Just the docs from v0.8.0 to v0.10.0. This gives an opportunity to remove: 1. Grand_parent (Function) to be replaced with just parent and children. 2. Easier to manage. - Note that with this No title can be the same in a file, if its the same the Url part has to be different. Additionally added a few files to overwrite a few that are usually defined globally, but to assure it works as intended. Removed Nav, no longer required. --- Removed GrandParent In previous version grand_parent was required, now it can just use parent: previous file . As required Files and issues have now been modified according to it. Fixes --- #110 [BUG] - Git & github 3rd child not shown #61 [ADDRESS] Child in Child in Child Content New --- ![image](https://github.com/user-attachments/assets/8b550149-b910-49ef-903c-1e3677bd8706) Previous --- ![image](https://github.com/user-attachments/assets/eb362b02-ac4e-44b3-94e4-1e24cd043a71) Known Issues --- - Currently none (Tested on mobile / Pc).
- Loading branch information
Showing
30 changed files
with
441 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 -%} | ||
<a href="{{ page.url | relative_url }}" class="nav-list-link"> | ||
{%- endcapture -%} | ||
|
||
{%- capture site_nav -%} | ||
{%- include_cached components/site_nav.html all=true -%} | ||
{%- endcapture -%} | ||
|
||
{%- capture nav_list_simple -%} | ||
<ul class="nav-list"> | ||
{%- endcapture -%} | ||
|
||
{%- capture nav_list_link_class %} class="nav-list-link"> | ||
{%- endcapture -%} | ||
|
||
{%- capture nav_category -%} | ||
<div class="nav-category"> | ||
{%- endcapture -%} | ||
|
||
{%- assign nav_anchor_splits = | ||
site_nav | split: nav_list_link | | ||
first | split: nav_category | | ||
last | split: "</a>" -%} | ||
|
||
{%- comment -%} | ||
The ordinary pages (if any) and the collections pages (if any) are separated by | ||
occurrences of nav_category. | ||
|
||
Any ancestor nav-links of the page are contained in the last group of pages, | ||
immediately preceding nav-lists. After splitting at "</a>", the anchor that | ||
was split is a potential ancestor link when the following split starts with | ||
a nav-list. | ||
|
||
The array nav_breadcrumbs is the stack of current potential ancestors of the | ||
current page. A split that contains one or more "</ul>"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: "<a " | last | prepend: "<a " | | ||
replace: nav_list_link_class, ">" | append: "</a>" -%} | ||
{%- assign nav_breadcrumbs = nav_breadcrumbs | push: nav_breadcrumb_link -%} | ||
{%- endif -%} | ||
|
||
{%- if nav_split_next contains "</ul>" -%} | ||
{%- assign nav_list_end_less = nav_split_next | remove: "</ul>" -%} | ||
{%- 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 -%} | ||
|
||
<nav aria-label="Breadcrumb" class="breadcrumb-nav"> | ||
<ol class="breadcrumb-nav-list"> | ||
{%- for nav_breadcrumb in nav_breadcrumbs %} | ||
<li class="breadcrumb-nav-list-item">{{ nav_breadcrumb }}</li> | ||
{%- endfor %} | ||
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li> | ||
</ol> | ||
</nav> | ||
|
||
{% if site.nav_error_report %} | ||
{{ nav_error_report }} | ||
{% endif %} | ||
|
||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 -%} | ||
<a href="{{ page.url | relative_url }}" class="nav-list-link"> | ||
{%- endcapture -%} | ||
|
||
{%- capture site_nav -%} | ||
{%- include_cached components/site_nav.html all=true -%} | ||
{%- endcapture -%} | ||
|
||
{%- capture nav_list_simple -%} | ||
<ul class="nav-list"> | ||
{%- endcapture -%} | ||
|
||
{%- assign nav_child_start = site_nav | ||
| split: nav_list_link | last | ||
| split: "</a>" | slice: 1 | first -%} | ||
|
||
{%- assign nav_child_test = nav_child_start | ||
| remove_first: nav_list_simple | prepend: nav_list_simple -%} | ||
|
||
{%- if nav_child_start != nav_child_test -%} | ||
{%- assign nav_children = "" | split: "" -%} | ||
{%- endif -%} | ||
|
||
{%- endif -%} | ||
|
||
{%- unless nav_children -%} | ||
|
||
{%- comment -%} | ||
The layout is assumed to include components/breadcrumbs.html before this file, | ||
otherwise it needs to be included here. | ||
{%- endcomment -%} | ||
|
||
{%- assign nav_ancestors = "" | split: "" -%} | ||
{%- for nav_link in nav_breadcrumbs -%} | ||
{%- assign nav_title = nav_link | split: ">" | slice: 1 | first | append: ">" | remove: "</a>" -%} | ||
{%- assign nav_ancestors = nav_ancestors | push: nav_title -%} | ||
{%- endfor -%} | ||
|
||
{%- assign nav_parenthood = site[page.collection] | default: site.html_pages | ||
| where_exp: "item", "item.title != nil" | group_by: "parent" -%} | ||
|
||
{%- assign nav_top_nodes = nav_parenthood | ||
| where_exp: "item", "item.name == ''" | map: "items" | first -%} | ||
|
||
{% assign nav_top_node_titles = nav_top_nodes | map: "title" -%} | ||
|
||
{%- include components/nav/children.html node=page ancestors=nav_ancestors all=true -%} | ||
|
||
{%- endunless -%} | ||
|
||
{%- if nav_children.size >= 1 -%} | ||
|
||
{%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%} | ||
{%- assign nav_children = nav_children | reverse -%} | ||
{%- endif -%} | ||
|
||
<hr> | ||
{% include toc_heading_custom.html %} | ||
<ul> | ||
{% for nav_child in nav_children %} | ||
<li> | ||
<a href="{{ nav_child.url | relative_url }}">{{ nav_child.title }}</a>{% if nav_child.summary %} - {{ nav_child.summary }}{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{%- endif -%} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{%- comment -%} | ||
Include as: {%- include components/nav/children.html node=node ancestors=title_array all=bool -%} | ||
Depends on: include.node, include.ancestors, include.all, nav_parenthood, nav_top_node_titles. | ||
Includes: components/nav/sorted.html. | ||
Assigns to: nav_children. | ||
Overwrites: | ||
nav_candidates, nav_child, nav_child_ok. | ||
{%- endcomment -%} | ||
|
||
{%- assign nav_children = "" | split: "" -%} | ||
|
||
{%- if include.all == true or include.node.has_children != false -%} | ||
|
||
{%- assign nav_candidates = nav_parenthood | ||
| where: "name", include.node.title | map: "items" | first -%} | ||
|
||
{%- for nav_child in nav_candidates -%} | ||
{%- assign nav_child_ok = true -%} | ||
|
||
{%- if nav_child.grand_parent and nav_child.grand_parent != include.node.parent -%} | ||
{%- assign nav_child_ok = false -%} | ||
{%- endif -%} | ||
|
||
{%- if nav_child.ancestor and nav_child.ancestor != include.node.title -%} | ||
{%- unless include.ancestors contains nav_child.ancestor -%} | ||
{%- assign nav_child_ok = false -%} | ||
{%- endunless -%} | ||
{%- endif -%} | ||
|
||
{%- comment -%} | ||
The following check rejects nav_child as 3rd-level when include.node is 2nd-level | ||
and nav_child can also be 2nd-level. This is for backwards compatibility with | ||
existing 3-level sites. | ||
{%- endcomment -%} | ||
{%- if nav_child.grand_parent == nil and nav_child.ancestor == nil and | ||
nav_top_node_titles contains nav_child.parent and include.ancestors.size >= 1 -%} | ||
{%- assign nav_child_ok = false -%} | ||
{%- endif -%} | ||
|
||
{%- if nav_child_ok -%} | ||
{%- assign nav_children = nav_children | push: nav_child -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
|
||
{%- endif -%} | ||
|
||
{%- include components/nav/sorted.html pages=nav_children -%} | ||
{%- assign nav_children = nav_sorted -%} |
Oops, something went wrong.