diff --git a/layouts/partials/helpers/get-section-id.html b/layouts/partials/helpers/get-section-id.html new file mode 100644 index 0000000..2dc13ab --- /dev/null +++ b/layouts/partials/helpers/get-section-id.html @@ -0,0 +1,5 @@ +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} +{{ return $sectionID }} \ No newline at end of file diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index fef2560..303aa3a 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -60,12 +60,8 @@ {{ if and (.section.enable) (.section.showOnNavbar)}} {{ $sectionCount = add $sectionCount 1}} {{ if lt $sectionCount 5 }} - {{ $sectionID := replace (lower .section.name) " " "-" }} - {{ if .section.id }} - {{ $sectionID = .section.id }} - {{ end }}