Use Scratch function get global variable in partial template.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{{- $langCode := replaceRE "-([a-z]+)" (upper (substr .Site.Language -3)) .Site.Language -}}
|
||||
{{- $P := .Site.Params -}}
|
||||
{{- .Scratch.Set "langCode" $langCode -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $langCode }}">
|
||||
<head>
|
||||
|
||||
Reference in New Issue
Block a user