forked from cntrump/hugo-notepadium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add iconfont and show profile at article bottom.
- Loading branch information
Showing
8 changed files
with
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ Features | |
- Custom article cover supporting | ||
- Article share supporting (thanks [@jianyuanzh](https://github.com/jianyuanzh)) | ||
- [Twitter Card](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary) supporting | ||
- Builtin iconfont (3KB) | ||
- Display author profile at article bottom | ||
|
||
Preview the exampleSite: | ||
|
||
|
@@ -364,6 +366,30 @@ cover = "01.png" | |
+++ | ||
``` | ||
|
||
### Display author profile at article bottom | ||
|
||
Edit `config.toml` | ||
|
||
```toml | ||
[params.author] | ||
enable = true | ||
avatar = "/img/avatar.jpg" | ||
name = "XXX" | ||
bio = "XXX" # support markdown syntax | ||
|
||
[params.author.twitter] | ||
name = "XXX" # https://twitter.com/XXX | ||
|
||
[params.author.github] | ||
name = "XXX" # https://github.com/XXX | ||
|
||
[params.author.docker] | ||
name = "XXX" # https://hub.docker.com/u/XXX | ||
|
||
[params.author.email] | ||
name = "[email protected]" # mailto:[email protected] | ||
``` | ||
|
||
## Thanks | ||
|
||
- [**Hugo**](https://gohugo.io/) | ||
|
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,38 @@ | ||
@font-face { | ||
font-family: "iconfont"; | ||
src: url('/assets/fonts/iconfont.ttf?t=1588390362269') format('truetype'); | ||
} | ||
|
||
.iconfont { | ||
font-family: "iconfont" !important; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
.icon-pagenext:before { | ||
content: "\e66b"; | ||
} | ||
|
||
.icon-pagepreview:before { | ||
content: "\e66c"; | ||
} | ||
|
||
.icon-twitter:before { | ||
content: "\e655"; | ||
} | ||
|
||
.icon-github:before { | ||
content: "\e732"; | ||
} | ||
|
||
.icon-email:before { | ||
content: "\e651"; | ||
} | ||
|
||
.icon-article:before { | ||
content: "\e67d"; | ||
} | ||
|
||
.icon-docker:before { | ||
content: "\e521"; | ||
} |
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,3 +1,29 @@ | ||
<!-- | ||
for user-side override | ||
--> | ||
{{- with site.Params.author -}} | ||
{{- if .enable -}} | ||
<section class="article author"> | ||
{{- with .avatar -}}<img class="avatar" src="{{- . | relURL -}}" alt>{{- end -}} | ||
|
||
{{- with .name -}}<p class="name">{{- . | safeHTML -}}<p>{{- end -}} | ||
|
||
{{- with .bio -}}<div class="bio">{{- . | markdownify -}}</div>{{- end -}} | ||
|
||
<div class="details"> | ||
{{- with .github -}} | ||
<a class="item" href="/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-github"></span></a> | ||
{{- end -}} | ||
|
||
{{- with .docker -}} | ||
<a class="item" href="https://hub.docker.com/u/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-docker"></span></a> | ||
{{- end -}} | ||
|
||
{{- with .twitter -}} | ||
<a class="item" href="https://twitter.com/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-twitter"></span></a> | ||
{{- end -}} | ||
|
||
{{- with .email -}} | ||
<a class="item" href="mailto:{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-email"></span></a> | ||
{{- end -}} | ||
</div> | ||
</section> | ||
{{- end -}} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{{- if and (not (eq .Params.single true)) (or .PrevInSection .NextInSection) -}} | ||
<section class="article navigation"> | ||
{{- with .NextInSection -}} | ||
<p><a class="link" href="{{- .RelPermalink -}}"><span class="li">←</span>{{- .Title | safeHTML -}}</a></p> | ||
<p><a class="link" href="{{- .RelPermalink -}}"><span class="li iconfont icon-article"></span>{{- .Title | safeHTML -}}</a></p> | ||
{{- end -}} | ||
{{- with .PrevInSection -}} | ||
<p><a class="link" href="{{- .RelPermalink -}}"><span class="li">→</span>{{- .Title | safeHTML -}}</a></p> | ||
<p><a class="link" href="{{- .RelPermalink -}}"><span class="li iconfont icon-article"></span>{{- .Title | safeHTML -}}</a></p> | ||
{{- end -}} | ||
</section> | ||
{{- 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
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
Binary file not shown.