diff --git a/config.yaml b/config.yaml index e8878374..3a0a7bae 100644 --- a/config.yaml +++ b/config.yaml @@ -6,6 +6,8 @@ module: params: publicCDN: "" + topTitle: false + announcement: enabled: false file: "README.md" diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 02927b50..4e34c47b 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -190,6 +190,10 @@ params: # CDN URL publicCDN: "" + # 在网站顶部显示标题和摘要,使用 .Site.Title 和 .Site.Params.Description + # Display title and description at the top of the page, use .Site.Title and .Site.Params.Description + topTitle: false + # 在首页顶部创建一个通知部分 # Create a Announcement section at the top of the home page announcement: diff --git a/layouts/_default/twitter.html b/layouts/_default/twitter.html index 0c45b6aa..90aaed0c 100644 --- a/layouts/_default/twitter.html +++ b/layouts/_default/twitter.html @@ -76,7 +76,7 @@ {{ if $lazyload }}data-{{ end }}srcset="{{- $processImage.Srcset -}}" {{ if $lazyload }}src="{{- or $processImage.Placeholder $lazyload_image -}}"{{ end }} {{- with $title -}}alt="{{- . -}}"{{- end -}} - class="w-full border border-x-0 border-solid border-gray-200 object-cover dark:border-darkBorder" + class="w-full border border-x-0 border-solid border-gray-100 object-cover dark:border-darkBorder" {{ if $imageZoom }}data-zoomable{{ end }} {{ if $lazyload }}data-lazyload data-lazyload-blur{{ end }} /> @@ -95,7 +95,7 @@ srcset="{{- $processImage.Srcset -}}" src="{{- print $public_cdn $processImage.Permalink -}}" {{- with $title -}}alt="{{- . -}}"{{- end -}} - class="w-full border border-x-0 border-solid border-gray-200 object-cover dark:border-darkBorder" + class="w-full border border-x-0 border-solid border-gray-100 object-cover dark:border-darkBorder" /> @@ -109,7 +109,7 @@ {{ if $lazyload }}data-{{ end }}src="{{- $picURL -}}" {{ if $lazyload }}src="{{- $lazyload_image -}}"{{ end }} {{- with $title -}}alt="{{- . -}}"{{- end -}} - class="w-full border border-x-0 border-solid border-gray-200 object-cover dark:border-darkBorder" + class="w-full border border-x-0 border-solid border-gray-100 object-cover dark:border-darkBorder" {{ if $imageZoom }}data-zoomable{{ end }} {{ if $lazyload }}data-lazyload{{ end }} /> diff --git a/layouts/partials/data/description.html b/layouts/partials/data/description.html index d92a190e..733f2b3b 100644 --- a/layouts/partials/data/description.html +++ b/layouts/partials/data/description.html @@ -1,8 +1,8 @@ -{{ $description := .Description }} -{{ if .IsPage }} +{{ $description := or .Description .Site.Params.description }} +{{- if .IsPage -}} - {{ $description = .Summary }} -{{ end }} + {{- $description = .Summary -}} +{{- end -}} -{{ return ($description | plainify)}} \ No newline at end of file +{{- return ($description | plainify) -}} \ No newline at end of file diff --git a/layouts/partials/html/header.html b/layouts/partials/html/header.html index db38b371..74378eb9 100644 --- a/layouts/partials/html/header.html +++ b/layouts/partials/html/header.html @@ -1,4 +1,11 @@
+ {{- if .Site.Params.topTitle -}} +
+ {{- with .Site.Title -}}
{{- . -}}
{{- end -}} + {{- with .Site.Params.Description -}}
{{- . -}}
{{- end -}} +
+ {{- end -}} + {{- $RelPermalink := .RelPermalink -}} {{- if .Site.Menus.main -}}