diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 26ef82d..29db0d1 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -18,6 +18,7 @@ dateFormat = "2006-01-02" paginationSinglePost = true # icp = "京ICP备xxxxx号-1" # for China ICP license +# police = "京公网安备 xxxxxxxx号" # for China police beian colorTheme = "auto" colorThemeSwitcher = true diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d0e4555..ea511b7 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -20,9 +20,20 @@ {{ end }} -
+
+ {{ $police := .Site.Params.police }} + {{ $info := "info" }} + {{ $pattern := "[0-9]+" }} + {{ $matches := findRE $pattern $police }} + {{ if $matches }} + {{ $firstNumber := index $matches 0 }} + {{ $info = print $firstNumber }} + 备案图标 + {{ .Site.Params.police }} +   + {{ end }} {{ if .Site.Params.icp }} - {{ .Site.Params.icp }} + {{ .Site.Params.icp }} {{ end }}