Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid expanding submenus #563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions exampleSite/content/basics/configuration/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Note that some of these parameters are explained in details in other sections of
showVisitedLinks = false
# Disable search function. It will hide search bar
disableSearch = false
# By default, the menu will show the entire tree for the current site.
# For sites with many subsites and pages, setting this option to true will
# limit the menu to the current page, its ancestors, and their children.
hideExtendedTree = false
# Javascript and CSS cache are automatically busted when new version of site is generated.
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
disableAssetsBusting = false
Expand Down
4 changes: 4 additions & 0 deletions exampleSite/content/basics/configuration/_index.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Notez que certains de ces paramètres sont expliqués en détails dans d'autres
showVisitedLinks = false
# Désactive la fonction de recherche. Une valeur à true cache la barre de recherche.
disableSearch = false
# Par défaut, le menu affichera l'intégralité de l'arborescence du site actuel.
# Pour les sites comportant de nombreux sous-sites et pages, définir cette option
# sur true limitera le menu à la page actuelle, à ses ancêtres et à leurs enfants.
hideExtendedTree = false
# Par défaut, le cache Javascript et CSS est automatiquement vidé lorsqu'une nouvelle version du site est générée.
# Utilisez ce paramètre lorsque vous voulez désactiver ce comportement (c'est parfois incompatible avec certains proxys)
disableAssetsBusting = false
Expand Down
6 changes: 4 additions & 2 deletions layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
<i class="fas fa-check read-icon"></i>
{{ end }}
</a>
{{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }}
{{ if ne $numberOfPages 0 }}
{{ if or (not .Site.Params.hideExtendedTree) (.IsAncestor $currentNode) (eq .File.UniqueID $currentFileUniqueID) }}
{{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }}
{{ if ne $numberOfPages 0 }}
<ul>
{{ $currentNode.Scratch.Set "pages" .Pages }}
{{ if .Sections}}
Expand All @@ -144,6 +145,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{ end }}
{{end}}
</ul>
{{ end }}
{{ end }}
</li>
{{else}}
Expand Down