diff --git a/README.md b/README.md index b071761..1793b0f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ +# Features +- 添加busuanzi页面计数功能 + ``` + [params.busuanzi] + enabled = true + ``` +- 添加百度统计 + ``` + [params.baidu] + enabled = true + id = "******" + ``` +- 底部悬挂ICP备案号 + ``` + [params.footer] + icp = "ICP备202308111103" + ``` + + +Original `README.md` +--- + ![image](https://user-images.githubusercontent.com/5889006/190859441-141b5f81-8483-40d2-bd96-ebf85616a46d.png) # Hugo Theme Stack diff --git a/assets/img/avatar.png b/assets/img/avatar.png index d90352c..14d5e60 100644 Binary files a/assets/img/avatar.png and b/assets/img/avatar.png differ diff --git a/assets/jsconfig.json b/assets/jsconfig.json index 040177a..377218c 100644 --- a/assets/jsconfig.json +++ b/assets/jsconfig.json @@ -1,12 +1,10 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": [ - "*" - ] - }, - "lib": ["es2020", "dom"], - "jsx": "preserve" - } + "compilerOptions": { + "baseUrl": ".", + "paths": { + "*": [ + "*" + ] + } + } } \ No newline at end of file diff --git a/layouts/partials/article/article.html b/layouts/partials/article/article.html index f3f7e90..8548948 100644 --- a/layouts/partials/article/article.html +++ b/layouts/partials/article/article.html @@ -1,5 +1,5 @@
- {{ partial "article/components/header" . }} + {{ partial "article/components/header_content" . }} {{ partial "article/components/content" . }} diff --git a/layouts/partials/article/components/details_content.html b/layouts/partials/article/components/details_content.html new file mode 100644 index 0000000..c572581 --- /dev/null +++ b/layouts/partials/article/components/details_content.html @@ -0,0 +1,73 @@ +
+ {{ if .Params.categories }} + + {{ end }} + +
+

+ + {{- .Title -}} + +

+ + {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} +
+ + {{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }} + {{ $showDate := not .Date.IsZero }} + {{ $showFooter := or $showDate $showReadingTime }} + {{ if $showFooter }} +
+ {{ if $showDate }} +
+ {{ partial "helper/icon" "date" }} + +
+ {{ end }} + + {{ if $showReadingTime }} +
+ {{ partial "helper/icon" "clock" }} + +
+ {{ end }} + + {{- if .Site.Params.busuanzi.enabled -}} +
+
+ + + 浏览量: + +
+
+ {{- end -}} + +
+ {{ end }} + + {{ if .IsTranslated }} + + {{ end }} +
diff --git a/layouts/partials/article/components/header_content.html b/layouts/partials/article/components/header_content.html new file mode 100644 index 0000000..92ceaeb --- /dev/null +++ b/layouts/partials/article/components/header_content.html @@ -0,0 +1,35 @@ +
+ {{- $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" -}} + {{ if $image.exists }} +
+ + {{ if $image.resource }} + {{- $Permalink := $image.resource.RelPermalink -}} + {{- $Width := $image.resource.Width -}} + {{- $Height := $image.resource.Height -}} + {{- $Srcset := "" -}} + + {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} + {{- $thumbnail := $image.resource.Resize "800x" -}} + {{- $thumbnailRetina := $image.resource.Resize "1600x" -}} + {{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}} + {{- $Permalink = $thumbnail.RelPermalink -}} + {{- $Width = $thumbnail.Width -}} + {{- $Height = $thumbnail.Height -}} + {{- end -}} + + Featured image of post {{ .Title }} + {{ else }} + Featured image of post {{ .Title }} + {{ end }} + +
+ {{ end }} + + {{ partialCached "article/components/details_content" . .RelPermalink }} +
\ No newline at end of file diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index c8d30cb..68c957c 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -8,6 +8,10 @@ {{ now.Format "2006" }} {{ .Site.Title }} + {{if (.Site.Params.footer.icp)}} + {{ (.Site.Params.footer.icp)}} + {{ end }} +
{{ with .Site.Params.footer.customText }} {{ . | safeHTML }}
diff --git a/layouts/partials/head/script.html b/layouts/partials/head/script.html index e69de29..b94dc13 100644 --- a/layouts/partials/head/script.html +++ b/layouts/partials/head/script.html @@ -0,0 +1,21 @@ + + +{{- if .Site.Params.baidu.enabled -}} + +{{- end -}} + + +{{- if .Site.Params.busuanzi.enabled -}} + + +{{- end -}} + + diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index 32e5a12..d66b593 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -32,7 +32,7 @@ {{ end }}
-

{{ .Site.Title }}

+

{{ .Site.Params.username }}

{{ .Site.Params.sidebar.subtitle }}