Merge pull request #43 from ChenYin626/main

added support for police beian for China ISP
This commit is contained in:
Junyi 2024-04-29 15:40:34 +08:00 committed by GitHub
commit f9b293c17d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

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

View File

@ -20,9 +20,20 @@
<a aria-label="Check statistics data" style="display: flex; align-items: center; border-bottom: none; cursor: pointer; color: var(--pagination-link-color)" href="{{ .Site.Params.UmamiAnalytics.shareUrl }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-report-analytics"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" /><path d="M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M9 17v-5" /><path d="M12 17v-1" /><path d="M15 17v-3" /></svg></a>
{{ end }}
</div>
<div>
<div style="display:flex;align-items: center">
{{ $police := .Site.Params.police }}
{{ $info := "info" }}
{{ $pattern := "[0-9]+" }}
{{ $matches := findRE $pattern $police }}
{{ if $matches }}
{{ $firstNumber := index $matches 0 }}
{{ $info = print $firstNumber }}
<img src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png" alt="备案图标" style="width: 1em;height: 1em;object-fit: contain;">
<a target="_blank" href="https://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{$info}}">{{ .Site.Params.police }}</a>
&nbsp;
{{ end }}
{{ if .Site.Params.icp }}
<a target="_blank" href="http://beian.miit.gov.cn/">{{ .Site.Params.icp }}</a>
<a target="_blank" href="https://beian.miit.gov.cn/">{{ .Site.Params.icp }}</a>
{{ end }}
</div>
<div>