mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-21 05:29:31 -07:00
fix(layouts): fix variable name from $name to $dirName in currentMenuItem.html partial to improve semantics and clarity
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
{{- $params := .Scratch.Get "params" -}}
|
{{- $params := .Scratch.Get "params" -}}
|
||||||
{{- $currentPage := . -}}
|
{{- $currentPage := . -}}
|
||||||
{{- with partial "function/currentMenuItem.html" . -}}
|
{{- with partial "function/currentMenuItem.html" . -}}
|
||||||
{{- partial "resources/imageJSON.html" (dict "Path" .Name "Page" $currentPage) -}}
|
{{- partial "resources/imageJSON.html" (dict "Path" .DirName "Page" $currentPage) -}}
|
||||||
<script>document.getElementById("main").setAttribute("currentMenuItemIndex", "{{- (sub .ID 1) -}}")</script>
|
<script>document.getElementById("main").setAttribute("currentMenuItemIndex", "{{- (sub .ID 1) -}}")</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{{- $params := .Scratch.Get "params" -}}
|
{{- $params := .Scratch.Get "params" -}}
|
||||||
{{- $currentPage := . -}}
|
{{- $currentPage := . -}}
|
||||||
{{- with partial "function/currentMenuItem.html" . -}}
|
{{- with partial "function/currentMenuItem.html" . -}}
|
||||||
{{- partial "resources/imageJSON.html" (dict "Path" .Name "Page" $currentPage) -}}
|
{{- partial "resources/imageJSON.html" (dict "Path" .DirName "Page" $currentPage) -}}
|
||||||
<script>document.getElementById("main").setAttribute("currentMenuItemIndex", "{{- (sub .ID 1) -}}")</script>
|
<script>document.getElementById("main").setAttribute("currentMenuItemIndex", "{{- (sub .ID 1) -}}")</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
{{- $currentPage := . -}}
|
{{- $currentPage := . -}}
|
||||||
|
|
||||||
{{- $name := "" -}}
|
{{- $dirName := "" -}}
|
||||||
{{- $id := -1 -}}
|
{{- $id := -1 -}}
|
||||||
|
|
||||||
{{- range site.Menus.main -}}
|
{{- range site.Menus.main -}}
|
||||||
{{ $menu_item_url := .URL | relLangURL }}
|
{{ $menu_item_url := .URL | relLangURL }}
|
||||||
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
|
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
|
||||||
{{ if eq $menu_item_url $page_url }}
|
{{ if eq $menu_item_url $page_url }}
|
||||||
{{- $name = .Identifier -}}
|
{{- $dirName = .Identifier -}}
|
||||||
{{- $id = .Weight -}}
|
{{- $id = .Weight -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- return (dict "Name" $name "ID" $id) -}}
|
{{- return (dict "DirName" $dirName "ID" $id) -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user