feat: Support to show the author of the article
This commit is contained in:
parent
d4ba47cd21
commit
332ee3cb2d
@ -494,6 +494,18 @@ article header h1 a {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.post-authors {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.post-authors li {
|
||||
display: inline;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
article img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
|
@ -88,6 +88,7 @@ locale = "pl-pl"
|
||||
[taxonomies]
|
||||
category = "categories"
|
||||
tag = "tags"
|
||||
author = "authors"
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
|
@ -13,6 +13,7 @@ categories = [
|
||||
"themes",
|
||||
"syntax",
|
||||
]
|
||||
authors = ["Mitrichius", "hugo"]
|
||||
aliases = ["migrate-from-jekyl"]
|
||||
favorite = true
|
||||
+++
|
||||
|
@ -7,6 +7,7 @@ tags = [
|
||||
"markdown",
|
||||
"text",
|
||||
]
|
||||
authors = ["hugo"]
|
||||
+++
|
||||
|
||||
Lorem est tota propiore conpellat pectoribus de
|
||||
|
@ -16,6 +16,9 @@ toOldPosts:
|
||||
tag:
|
||||
other: "tag"
|
||||
|
||||
author:
|
||||
other: "author"
|
||||
|
||||
Tags:
|
||||
other: "Tags"
|
||||
|
||||
@ -31,6 +34,9 @@ Categories:
|
||||
toAllTags:
|
||||
other: "to all tags"
|
||||
|
||||
toAllAuthors:
|
||||
other: "to all authors"
|
||||
|
||||
toAllCategories:
|
||||
other: "to all categories"
|
||||
|
||||
|
@ -16,6 +16,9 @@ toOldPosts:
|
||||
tag:
|
||||
other: "标签"
|
||||
|
||||
author:
|
||||
other: "作者"
|
||||
|
||||
Tags:
|
||||
other: "标签"
|
||||
|
||||
@ -31,6 +34,9 @@ Categories:
|
||||
toAllTags:
|
||||
other: "所有标签"
|
||||
|
||||
toAllAuthors:
|
||||
other: "所有作者"
|
||||
|
||||
toAllCategories:
|
||||
other: "所有类别"
|
||||
|
||||
|
@ -29,5 +29,13 @@
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ if .Params.authors }}
|
||||
<ul class="post-authors">
|
||||
{{ range $author_name := .Params.authors }}
|
||||
{{ $author := ($.Site.GetPage (printf "/authors/%s" $author_name)) }}
|
||||
<li><a href="{{ $author.Permalink }}">@{{ $author_name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user