Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking] fix: move .Site.Author to .Site.Params.Author #1361

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 109 additions & 109 deletions assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,113 @@
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

/*
! tailwindcss v3.4.11 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.12 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -669,114 +777,6 @@ html.dark {
--showcase-hover-color: white;
}

*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

.tw-m-0 {
margin: 0px;
}
Expand Down
8 changes: 0 additions & 8 deletions exampleSite/config/_default/author.toml

This file was deleted.

7 changes: 7 additions & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ license = '<a rel="license external nofollow noopener noreffer" href="https://cr
# [Experimental] Bundle js
bundle = false

[author]
name = "PCloud"
email = "[email protected]"
link = "https://github.com/HEIGE-PCloud"
avatar = "/images/avatar.webp"
gravatarEmail = "[email protected]"

[image]
# cache remote images for better optimisations
# 缓存图片链接到本地
Expand Down
17 changes: 8 additions & 9 deletions exampleSite/content/posts/theme-documentation-basics/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,16 @@ Please open the code block below to view the complete sample configuration {{< f
srcsetSmallResizeMethod = "700x webp Lanczos q75"
srcsetDefaultResizeMethod = "1200x webp Lanczos q75"
srcsetLargeResizeMethod = "2000x webp Lanczos q75"
# {{< version 0.2.0 >}} App icon config
# {{< version 0.2.14 >}} License information
license = '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
# Author config
[params.author]
name = "xxxx"
email = ""
link = ""
avatar = ""
gravatarEmail = ""
# {{< version 0.2.0 >}} App icon config
[params.app]
# optional site title override for the app when added to an iOS home screen or Android launcher
title = "DoIt"
Expand Down Expand Up @@ -868,14 +875,6 @@ Please open the code block below to view the complete sample configuration {{< f
startLevel = 2
endLevel = 6

# Author config
[author]
name = "xxxx"
email = ""
link = ""
avatar = ""
gravatarEmail = ""

# Sitemap config
[sitemap]
changefreq = "weekly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ optimizeImages = true
srcsetLargeResizeMethod = "2000x webp Lanczos q75"
# {{< version 0.2.14 >}} 版权信息
license = '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
avatar = ""
gravatarEmail = ""
# {{< version 0.2.0 >}} 应用图标配置
[params.app]
# 当添加到 iOS 主屏幕或者 Android 启动器时的标题, 覆盖默认标题
Expand Down Expand Up @@ -870,14 +877,6 @@ optimizeImages = true
startLevel = 2
endLevel = 6

# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
avatar = ""
gravatarEmail = ""

# 网站地图配置
[sitemap]
changefreq = "weekly"
Expand Down
6 changes: 3 additions & 3 deletions layouts/index.feed
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
{{ end -}}
"icon" : "{{ `/apple-touch-icon.png` | absURL }}",
"favicon" : "{{ `/favicon.ico` | absURL }}",
{{ with .Site.Author.name -}}
{{ with .Site.Params.Author.name -}}
"author" : {
"name" : "{{ . }}"{{ with $.Site.Author.link }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"name" : "{{ . }}"{{ with $.Site.Params.Author.link }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Params.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
},
{{ end -}}
Expand Down
6 changes: 3 additions & 3 deletions layouts/index.rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.Author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

{{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}}
<span class="author">&nbsp;<a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank" rel="noopener noreferrer">{{ .Site.Author.name }}</a></span>
<span class="author">&nbsp;<a href="{{ $.Site.Params.Author.link | default .Site.Home.RelPermalink }}" target="_blank" rel="noopener noreferrer">{{ .Site.Params.Author.name }}</a></span>
{{- end -}}

{{- /* License */ -}}
Expand Down
12 changes: 6 additions & 6 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := .Params.author | default .Site.Author.name | default (T "author") | dict "name" -}}
{{- $publisher := .Params.author | default .Site.Params.Author.name | default (T "author") | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
Expand Down Expand Up @@ -137,8 +137,8 @@
{{- end -}}
],
{{- else -}}
{{- $link := .Params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
{{- $link := .Params.authorlink | default .Site.Params.Author.link | default .Site.Home.RelPermalink -}}
{{- with .Params.author | default .Site.Params.Author.name | default (T "author") -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }},
Expand Down Expand Up @@ -171,7 +171,7 @@
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Author.name -}}
{{- with .Site.Params.Author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
Expand Down Expand Up @@ -216,10 +216,10 @@
"@type": "Person",
"name": {{ .Site.Params.footer.author | safeHTML }}
},
{{- else if .Site.Author.name -}}
{{- else if .Site.Params.Author.name -}}
"copyrightHolder": {
"@type": "Person",
"name": {{ .Site.Author.name | safeHTML }}
"name": {{ .Site.Params.Author.name | safeHTML }}
},
{{- end -}}
"name": {{ .Site.Title | safeHTML }}
Expand Down
Loading
Loading