From 5a785c8e2a8fca72669ff714874e4b6c83f728e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Dav=C3=B3?= Date: Mon, 2 Oct 2023 20:50:54 +0200 Subject: [PATCH] Created get-section-url helper --- layouts/partials/helpers/get-section-url.html | 5 +++++ layouts/partials/navigators/navbar.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/helpers/get-section-url.html diff --git a/layouts/partials/helpers/get-section-url.html b/layouts/partials/helpers/get-section-url.html new file mode 100644 index 0000000..2a902f4 --- /dev/null +++ b/layouts/partials/helpers/get-section-url.html @@ -0,0 +1,5 @@ +{{- if page.IsHome -}} + #{{ partial "helpers/get-section-id.html" . }} +{{- else -}} + {{ site.BaseURL | relLangURL }}#{{ partial "helpers/get-section-id.html" . }} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index 114fa6e..aaace5c 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -88,7 +88,7 @@ {{ $sectionCount = add $sectionCount 1}} {{ if le $sectionCount $maxVisibleSections }} {{ end }} {{ end }} @@ -102,7 +102,7 @@ {{ if and (.section.enable) (.section.showOnNavbar) }} {{ $sectionCount = add $sectionCount 1}} {{ if gt $sectionCount $maxVisibleSections }} - {{ .section.name }} + {{ .section.name }} {{ end }} {{ end }} {{- end }}