diff options
-rw-r--r-- | exampleSite/content/post/first.md | 2 | ||||
-rw-r--r-- | layouts/partials/article_header.html | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/exampleSite/content/post/first.md b/exampleSite/content/post/first.md index ef6e9f2..3e0c28d 100644 --- a/exampleSite/content/post/first.md +++ b/exampleSite/content/post/first.md @@ -4,6 +4,8 @@ title = "first" categories = ["技术文章"] tags = ["Foo", "Bar"] toc = true +author = "coderzh" +author_homepage = "http://blog.coderzh.com/post/" +++ diff --git a/layouts/partials/article_header.html b/layouts/partials/article_header.html index 91235db..8409b8f 100644 --- a/layouts/partials/article_header.html +++ b/layouts/partials/article_header.html @@ -3,8 +3,8 @@ <a href="{{ .Permalink }}" title="{{ .Title }}" itemprop="url">{{ .Title }}</a> </h1> <p class="article-author">By - {{ if and (isset .Params "Author") (isset .Params "AuthorHomepage") }} - <a href="{{ .Params.author_homepage }}" title="{{ .Params.author }}">{{ .Params.Author }}</a> + {{ if and (isset .Params "author") (isset .Params "author_homepage") }} + <a href="{{ .Params.author_homepage }}" title="{{ .Params.author }}">{{ .Params.author }}</a> {{ else }} <a href="{{ .Site.Params.AuthorHomepage }}" title="{{ .Site.Author.Name }}">{{ .Site.Author.Name }}</a> {{ end }} |