Skip to content

Commit

Permalink
feat: allow optional navbar entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jgazeau committed Aug 24, 2024
1 parent 476f91f commit 4aa7058
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions assets/sass/theme/global.sass
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ html
scroll-behavior: smooth
.is-modal
cursor: zoom-in
.is-enforced-hidden
display: none !important
kbd
box-shadow: inset 0 0.1rem 0.2rem tint($grey-light, 80), inset 0 -0.1rem 0.2rem tint($grey-light, 20)
background: linear-gradient(tint($grey-light, 20), tint($grey-light, 80))
Expand Down
10 changes: 7 additions & 3 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ themesdir = "../.."
faviconmd = "![Favicon](/images/favicon.png)"
homeLayout = "onboarding"
siteContentOrder = "weight"
# toc = true
# globalBanner = true
# toc = true
# globalBanner = true
currentVersion = "latest"
latestVersionUrl = "https://jgazeau.github.io/shadocs/"
# enforceRefrelLinks = true
# enforceRefrelLinks = true
# navbarPrintEntry = false
# navbarQRCodeEntry = false
# navbarSchortcutsEntry = false
# navbarInfo = false
[params.navbar.shortcuts]
[params.navbar.shortcuts.example]
keys = ["Shift","1"]
Expand Down
8 changes: 8 additions & 0 deletions exampleSite/templates/configuration/config.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
latestVersionUrl = "https://jgazeau.github.io/shadocs/"
# Enforce Link resolution using relref function (https://gohugo.io/content-management/cross-references/)
enforceRefrelLinks = true
# Disable "Print" button in navbar
# navbarPrintEntry = false
# Disable "QR code" button in navbar
# navbarQRCodeEntry = false
# Disable "Shortcuts" button in navbar
# navbarSchortcutsEntry = false
# Disable "About" button in navbar
# navbarInfo = false
# Keyboard shortcuts list
# For each shortcut following keys must be sets:
# - keys = [Keyboard shortcuts table](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
Expand Down
8 changes: 8 additions & 0 deletions exampleSite/templates/configuration/config.fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
latestVersionUrl = "https://jgazeau.github.io/shadocs/"
# Force la résolution des liens en utilisant la fonction relref (https://gohugo.io/content-management/cross-references/)
enforceRefrelLinks = true
# Désactive le bouton "Imprimer" dans la barre de navigation
# navbarPrintEntry = false
# Désactive le bouton "QR code" dans la barre de navigation
# navbarQRCodeEntry = false
# Désactive le bouton "Raccourcis" dans la barre de navigation
# navbarSchortcutsEntry = false
# Désactive le bouton "À propos" dans la barre de navigation
# navbarInfo = false
# Liste des raccourcis clavier
# Pour chaque raccourci il faut renseigner les clés suivantes:
# - keys = [Table des touches de clavier du raccourci](https://developer.mozilla.org/fr/docs/Web/API/KeyboardEvent/key/Key_Values)
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/theme/navbar-items.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="navbar-item">
<div class="navbar-item{{ with not (default true $.Site.Params.navbarPrintEntry ) }} is-enforced-hidden{{ end }}">
<a
id="printButton{{- $.Scratch.Get "navbarExtendIdSuffix" -}}"
class="button navbar-item-standard"
Expand All @@ -9,7 +9,7 @@
</span>
</a>
</div>
<div class="navbar-item">
<div class="navbar-item{{ with not (default true $.Site.Params.navbarQRCodeEntry ) }} is-enforced-hidden{{ end }}">
<a
id="qrCodeButton{{- $.Scratch.Get "navbarExtendIdSuffix" -}}"
class="button navbar-item-standard"
Expand All @@ -20,7 +20,7 @@
</span>
</a>
</div>
<div class="navbar-item">
<div class="navbar-item{{ with not (default true $.Site.Params.navbarSchortcutsEntry ) }} is-enforced-hidden{{ end }}">
<a
id="shortcutsInfo{{- $.Scratch.Get "navbarExtendIdSuffix" -}}"
trigger="navbarShortcuts"
Expand Down Expand Up @@ -56,7 +56,7 @@
{{- partial "theme/version-selector.html" $ -}}
</div>
{{- end -}}
<div class="navbar-item">
<div class="navbar-item{{ with not (default true $.Site.Params.navbarInfo ) }} is-enforced-hidden{{ end }}">
<a
id="siteInfo{{- $.Scratch.Get "navbarExtendIdSuffix" -}}"
trigger="navbarInfo"
Expand Down

0 comments on commit 4aa7058

Please sign in to comment.