Use Scratch function get global variable in partial template.

This commit is contained in:
凡梦星尘
2022-05-07 21:24:29 +08:00
parent 4755b77427
commit cf923ad102
3 changed files with 5 additions and 5 deletions

View File

@@ -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>