Files
bridget/layouts/partials/head/link.html
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

62 lines
2.4 KiB
HTML

{{/* fingerprint */}}
{{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}}
{{/* critical style */}}
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}}
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") -}}
{{- $style = dict "Context" . "ToCSS" $options "Inline" true | merge $style -}}
{{- partial "plugin/style.html" $style -}}
{{/* main style */}}
{{- if (site.Params.bundled | default true) -}}
{{- $style := dict "Link" "/bundled/css/style.min.css" "Defer" true -}}
{{- partial "plugin/style.html" $style -}}
{{- else -}}
{{- $style := dict "Source" "scss/style.scss" "Fingerprint" $fingerprint -}}
{{- $options := dict "targetPath" "css/style.css" "enableSourceMap" true "includePaths" (slice "node_modules") -}}
{{- $style = dict "Context" . "ToCSS" $options "Minify" hugo.IsProduction "Defer" true | merge $style -}}
{{- partial "plugin/style.html" $style -}}
{{- end -}}
{{/* main js */}}
{{- $script := dict "Link" "/bundled/js/main.js" "Defer" true "Esm" true -}}
{{- partial "plugin/script.html" $script -}}
{{/* fonts */}}
<link rel="preload" href="/lib/fonts/fw.woff2" as="font" crossorigin />
{{- if (partial "function/langCode.html" (slice "en" "de" "fr" "es" "it")) -}}
<link rel="preload" href="/lib/fonts/GeistVF.woff2" as="font" crossorigin />
{{- else if (partial "function/langCode.html" (slice "zh-cn" "zh-sg")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKsc-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "zh-tw" "zh-hk" "zh-mo")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKtc-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "ja")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKjp-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "ko")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKkr-Regular.woff2"
as="font"
crossorigin
/>
{{- end -}}