diff --git a/README.md b/README.md index 341d52d..b599986 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ For more explanation about some features, scroll down to **Features** * **(+)** Multiple taxonomies work flawless with single post * **(+)** New list of all taxonomies and tags below the post in single view * **(+)** New array front matter notaxonomy +* **(+)** Author/Writer display in post with extra features * Multilingual support for month names * Syntax highlighting * Custom CSS @@ -167,7 +168,7 @@ under the post. With the new front matter `notaxanomy` you can specify every taxonomy that should **not be visible** below the content. You can also use the type page -as explained at **Content type** to disable the taxonomie view completely. +as explained at **Content type** to disable the taxonomie view completely. ```md +++ @@ -183,6 +184,17 @@ notaxonomy = ["series","authors"] In the example above the post does only show the "tags" below the content. +### Display for author/writer + +The author/writer can now be displayed on the content page. To activate the +function, the option `listAuthor` must be set to `true` in the config. + +If you consider to give a link to the author, just use the new front matter +`authorlink`. This option creates a link on the author name to the selected +website. + +All content that has no author set, will not use this feature obviously. + ## Credits * [hugo-ink](https://github.com/knadh/hugo-ink) from which Vitae was forked diff --git a/i18n/en.yaml b/i18n/en.yaml index f0370cf..04f8a92 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -10,3 +10,6 @@ - id: commentsdisqus translation: "comments powered by" + +- id: authorpretext + translation: "Written by" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 79c86cb..f37fc70 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,6 +6,17 @@ {{ partial "head.html" . }}
+
+ {{ if eq .Site.Params.listAuthor true}} + {{ if isset .Params "author" }} + {{ if isset .Params "authorlink" }} + {{ i18n "authorpretext" }} {{ .Params.author }} + {{ else }} + {{ i18n "authorpretext" }} {{ .Params.author }} + {{ end }} + {{ end }} + {{ end }} +
{{ if ne .Date.Year 1 }}
diff --git a/static/css/main.css b/static/css/main.css index e7102d6..bdbd158 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -443,13 +443,18 @@ ul { .termsfloating_right { float: right; width: 80%; - border-top: 1px solid #eee; } .taxosfloating_left { float: left; width: 20%; - border-top: 1px solid #eee; +} + +.author { + font-size: 1.2rem; + font-weight: bold; + text-align: left; + margin-bottom: 10px; } @media (max-width: 900px) {