Theme Files Update

This commit is contained in:
GitHub Action 2023-11-12 15:26:10 +00:00
parent 9be4cc1b9b
commit d7d6b817bd
7 changed files with 54 additions and 37 deletions

View file

@ -1,15 +1,20 @@
<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
<head>
{{- partial "analytics.html" . }}
{{- partial "analytics.html" . -}}
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{{- with .Site.Params.themeColor }}
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="15 days">
{{ $author := (.Params.author | default .Site.Params.author.name) -}}
<meta name="author" content="{{ $author }}">
{{ with .Site.Params.themeColor -}}
<meta name="theme-color" content="{{.}}">
<meta name="msapplication-TileColor" content="{{.}}">
{{- end -}}
{{- with .Params.description -}}<meta name="description" content="{{.}}">{{- end -}}
{{- partial "structured-data.html" . -}}
{{- partial "favicons.html" -}}
<title>{{.Title}}</title>
@ -19,21 +24,19 @@
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- range .Params.custom_css -}}<link rel="stylesheet" href="{{ . | absURL }}">{{- end -}}
{{- block "head" . -}}{{- end }}
{{- if templates.Exists "partials/extra-head.html" -}}{{ partial "extra-head.html" . }}{{- end }}
</head>
{{- block "head" . -}}{{- end -}}
{{- if templates.Exists "partials/extra-head.html" -}}{{- partial "extra-head.html" . -}}{{- end -}}</head>
<body id="page">
{{ block "header" . -}}{{ end -}}
{{ block "main" . -}}{{ end -}}
{{ block "footer" . -}}{{ end }}
{{ partial "scroll-to-top.html" . }}
{{ $main := resources.Get "js/main.js" -}}
{{ if .Site.Params.code_copy_button | default true -}}
{{- block "header" . -}}{{ end -}}
{{- block "main" . -}}{{ end -}}
{{- block "footer" . -}}{{ end }}
{{- partial "scroll-to-top.html" . }}
{{- $main := resources.Get "js/main.js" -}}
{{- if .Site.Params.code_copy_button | default true -}}
{{ $codeCopy := resources.Get "js/code-copy.js" -}}
{{ $script := slice $main $codeCopy | resources.Concat "js/bundle.js" | minify | fingerprint -}}
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{ else -}}
{{- else -}}
{{ $script := $main | minify | fingerprint -}}
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end -}}
@ -41,9 +44,9 @@
{{ $linkshare := resources.Get "js/link-share.js" | minify | fingerprint -}}
<script async src="{{ $linkshare.Permalink }}" {{ printf "integrity=%q" $linkshare.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end -}}
{{ range .Params.custom_js -}}<script type="text/javascript" src="{{ . | absURL }}"></script>{{- end }}
{{ partial "mathjax.html" . }}
{{- if templates.Exists "partials/extra-foot.html" -}}{{ partial "extra-foot.html" . }}{{- end }}
{{- range .Params.custom_js -}}<script type="text/javascript" src="{{ . | absURL }}"></script>{{- end }}
{{- partial "mathjax.html" . -}}
{{- if templates.Exists "partials/extra-foot.html" -}}{{- partial "extra-foot.html" . -}}{{- end }}
</body>
</html>

View file

@ -19,7 +19,7 @@
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
<div class="content">
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true">{{- partial "svg.html" (dict "context" . "name" "content-anchor") -}}</a>${3}` | safeHTML }}
</div>
{{- if .Params.comments }}
<div id="comments" class="thin">