-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add sponsor support * fix: add noopener noreferrer to a t ag * fix: gravatarEmail are fixed * chore: add i18n config support for sponsor config * docs: add documentation for sponsor settings
- Loading branch information
1 parent
3186a71
commit 071235d
Showing
17 changed files
with
180 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.sponsor { | ||
text-align: center; | ||
padding-top: 50px; | ||
.sponsor-avatar { | ||
img { | ||
display: inline-block; | ||
width: 6rem; | ||
height: 6rem; | ||
margin: 10px; | ||
@include border-radius(100%); | ||
@include box-shadow(0 0 0 .3618em rgba(0, 0, 0, .05)); | ||
} | ||
} | ||
.sponsor-custom { | ||
margin: 30px auto; | ||
display: block; | ||
} | ||
.sponsor-bio { | ||
width: 25%; | ||
margin: 10px auto; | ||
} | ||
.sponsor-button { | ||
border-width: 0px; | ||
border-style: solid; | ||
padding: 5px 10px; | ||
margin: 15px auto; | ||
display: inline-block; | ||
background-color: #f0f0f0; | ||
-webkit-transition: transform 0.4s ease; | ||
-moz-transition: transform 0.4s ease; | ||
-o-transition: transform 0.4s ease; | ||
transition: transform 0.4s ease; | ||
&:hover { | ||
background-color: #f0f0f0; | ||
@include transform(scale(1.05)); | ||
} | ||
[theme="dark"] & { | ||
background-color: #363636; | ||
} | ||
[theme="black"] & { | ||
background-color: #363636; | ||
} | ||
span { | ||
vertical-align: top; | ||
} | ||
} | ||
} | ||
@media only screen and (max-width: 1000px) { | ||
.sponsor { | ||
.sponsor-bio { | ||
width: 50%; | ||
} | ||
} | ||
} | ||
@media only screen and (max-width: 680px) { | ||
.sponsor { | ||
.sponsor-bio { | ||
width: 75%; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,13 @@ enableEmoji = true | |
[languages.en.params.social.Mastodon] | ||
id = "@xxxx" | ||
prefix = "https://mastodon.technology/" | ||
# Sponsor config | ||
[languages.en.params.sponsor] | ||
enable = true | ||
bio = "If you find this post helpful, please consider sponsoring." | ||
link = "https://github.com/sponsors/HEIGE-PCloud" | ||
# custom = "<a href=\"https://www.buymeacoffee.com/PCloud\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 40px !important;width: 145 !important;\" ></a>" | ||
|
||
|
||
[languages.zh-cn] | ||
weight = 2 | ||
|
@@ -487,6 +494,13 @@ enableEmoji = true | |
QQGroup = "" | ||
Email = "[email protected]" | ||
RSS = true | ||
# 赞助设置 | ||
[languages.zh-cn.params.sponsor] | ||
enable = true | ||
bio = "如果你觉得这篇文章对你有所帮助,欢迎赞赏~" | ||
link = "https://github.com/sponsors/HEIGE-PCloud" | ||
# custom = "<a href=\"https://www.buymeacoffee.com/PCloud\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 40px !important;width: 145 !important;\" ></a>" | ||
|
||
|
||
[params] | ||
# website title | ||
|
@@ -888,6 +902,14 @@ enableEmoji = true | |
name = "xxxx" | ||
logoUrl = "/images/avatar.webp" | ||
|
||
# Sponsor config | ||
# 赞助设置 | ||
[params.sponsor] | ||
enable = true | ||
bio = "If you find this post helpful, please consider sponsoring." | ||
link = "https://github.com/sponsors/HEIGE-PCloud" | ||
# custom = "<a href=\"https://www.buymeacoffee.com/PCloud\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 40px !important;width: 145 !important;\" ></a>" | ||
|
||
# TypeIt config | ||
# TypeIt 配置 | ||
[params.typeit] | ||
|
@@ -1030,6 +1052,8 @@ enableEmoji = true | |
name = "PCloud" | ||
email = "[email protected]" | ||
link = "https://github.com/HEIGE-PCloud" | ||
avatar = "/images/avatar.webp" | ||
gravatarEmail = "" | ||
|
||
# Sitemap config | ||
# 网站地图配置 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
name = "Dillon" | ||
link = "https://dillonzq.com" | ||
link = "https://dillonzq.com" | ||
avatar = "/images/avatar.webp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
name = "PCloud" | ||
link = "https://github.com/HEIGE-PCloud" | ||
email = "[email protected]" | ||
email = "[email protected]" | ||
avatar = "https://avatars.githubusercontent.com/u/52968553?v=4" | ||
# gravatarEmail = "" |
2 changes: 1 addition & 1 deletion
2
...leSite/resources/_gen/assets/scss/css/style.scss_d75fd08668b4bae707167bbce4d8ca46.content
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- $enable := .Params.sponsor.enable | default .Site.Params.sponsor.enable -}} | ||
{{- $avatar := .Site.Author.avatar -}} | ||
{{- with .Site.Author.gravataremail -}} | ||
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}} | ||
{{- end -}} | ||
{{- $bio := .Params.sponsor.bio | default .Site.Params.sponsor.bio -}} | ||
{{- $link := .Params.sponsor.link | default .Site.Params.sponsor.link -}} | ||
{{- $custom := .Params.sponsor.custom | default .Site.Params.sponsor.custom -}} | ||
{{- $authors := .Params.authors -}} | ||
|
||
{{- if $enable -}} | ||
<div class="sponsor"> | ||
<div class="sponsor-avatar"> | ||
{{- if $authors -}} | ||
{{- $lang := ( $.Params.lang | default $.Lang ) -}} | ||
{{- range $i, $name := $authors -}} | ||
{{- with partial "function/author.html" (dict | ||
"name" $name | ||
"author" (index $.Site.Data.authors $name) | ||
"lang" $lang) -}} | ||
{{- dict "Src" .avatar | partial "plugin/image.html" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- else if $avatar -}} | ||
{{- dict "Src" $avatar | partial "plugin/image.html" -}} | ||
{{- end -}} | ||
</div> | ||
{{- with $bio -}} | ||
<p class="sponsor-bio"><em>{{- . -}}</em></p> | ||
{{- end -}} | ||
{{- if $custom -}} | ||
<div class="sponsor-custom"> | ||
{{- $custom | safeHTML -}} | ||
</div> | ||
{{- else -}} | ||
<a href="{{- $link -}}" title="Sponsor" target="_blank" class="sponsor-button" rel="noopener noreferrer"> | ||
<i class="far fa-heart fa-fw icon" style="color: #ec6cb9;"></i> | ||
<span>{{- T "sponsor" -}}</span> | ||
</a> | ||
{{- end -}} | ||
</div> | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
071235d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: