mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
feat(langCode.html): add a new partial template to check if the current language code matches the site's language code
The `langCode.html` partial template is added to the `layouts/partials/function` directory. This template is used to check if the current language code matches the site's language code. It iterates over the language codes and sets a boolean variable `$res` to `true` if there is a match. The template then returns the value of `$res`. This partial template can be used in other templates to conditionally render content based on the language code.
This commit is contained in:
9
layouts/partials/function/langCode.html
Normal file
9
layouts/partials/function/langCode.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- $res := false -}}
|
||||
|
||||
{{- range . -}}
|
||||
{{- if eq site.LanguageCode . -}}
|
||||
{{- $res = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $res -}}
|
||||
Reference in New Issue
Block a user