Files
bridget/layouts/_default/single.json
Spedon 8ba41fc32c v0.0.5 (#219)
* feat: refactor condition for checking `site.Params.bundled`

- Add default condition for checking if `site.Params.bundled` is true or false

* refactor: update info page content

* chore: update site description

* refactor: refactor variable assignments and return statement in menu template

- Change the variable assignment from `.DirName` to `.Identifier` in the file `layouts/_default/single.json`
- Change the variable assignments in the file `layouts/partials/function/currentMenuItem.html`:
  - From `$dirName := ""` to `$identifier := ""`
  - From `$id := -1` to `$title := ""` and `$weight := -1`
  - From `$dirName = .Identifier` to `$identifier = .Identifier`, `$title = .Title`, and `$weight = .Weight`
- Change the return statement in the file `layouts/partials/function/currentMenuItem.html` from `(dict "DirName" $dirName "ID" $id)` to `(dict "Identifier" $identifier "Title" $title "Weight" $weight)`

* feat: update nav links structure for current link styling

- Remove javascript code related to setting current link style and title
- Update nav links to use updated HTML structure for current link styling

* feat: update page titles and meta tags in layout files

- Update the `baseof.html` layout to include the current page title in the `<title>` tag
- Add OpenGraph meta tags for the page title and description in `meta.html` layout
2024-01-07 23:16:55 +08:00

38 lines
1.1 KiB
JSON

{{- $Page := . -}}
{{- $Path := "" -}}
{{- $params := .Page.Params | merge .Site.Params.Page -}}
{{- with partial "function/currentMenuItem.html" . -}}
{{- $Path = .Identifier -}}
{{- end -}}
{{- $gallery := site.GetPage $Path -}}
{{- with $gallery.Resources.ByType "image" -}}
{{- $index := len . -}}
{{- $Page.Scratch.Add "img" slice -}}
{{- range sort . "Name" "desc" -}}
{{- $image := . -}}
{{- $index = sub $index 1 -}}
{{- $alt := .Name -}}
{{- with $params.unifiedAlt -}}
{{- $alt = . -}}
{{- end -}}
{{- $lores := .Resize (site.Params.loResOpt | default "700x webp Lanczos q60") -}}
{{- $hires := .Resize (site.Params.hiResOpt | default "2000x webp Lanczos q75") -}}
{{- $Page.Scratch.Add "img" (dict
"index" (int $index)
"alt" (string $alt)
"loUrl" (string $lores.RelPermalink)
"loImgH" (int $lores.Height)
"loImgW" (int $lores.Width)
"hiUrl" (string $hires.RelPermalink)
"hiImgH" (int $hires.Height)
"hiImgW" (int $hires.Width)
)
-}}
{{- end -}}
{{ $Page.Scratch.Get "img" | jsonify }}
{{- else -}}
[]
{{- end -}}