Files
bridget/layouts/partials/function/currentMenuItem.html
Spedon ba07636f8f refactor: prefine for version v1.0.2 (#269)
* refactor: refactor navigateVector logic and remove unused functions

* refactor: refactor HTML structure and styling in single.html

- Modify the `.info` class to `article` in `_article.scss`
- Remove the `nav.html` partial in `single.html`
- Change the class name from `info` to `article` in `single.html`
- Add the `nav.html` partial in `single.html`

* refactor: update handling of 404 page
- Now hugo will set unknown page title as "404"
- Add condition to return an empty image array if the document title starts with "404"

* docs: update documentation
2024-02-05 16:02:10 +08:00

18 lines
474 B
HTML

{{- $currentPage := . -}}
{{- $identifier := "" -}}
{{- $title := "404" -}}
{{- $weight := -1 -}}
{{- range site.Menus.main -}}
{{ $menu_item_url := .URL | relLangURL }}
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
{{ if eq $menu_item_url $page_url }}
{{- $identifier = .Identifier -}}
{{- $title = .Title -}}
{{- $weight = .Weight -}}
{{- end -}}
{{- end -}}
{{- return (dict "Identifier" $identifier "Title" $title "Weight" $weight) -}}