diff --git a/README.md b/README.md index 4be9820..8a02716 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,11 @@ theme = "binario" disqusShortname = "" # Enable comments by entering your Disqus shortname googleAnalytics = "" # Enable Google Analytics by entering your tracking id +[Author] # Used in authorbox + name = "John Doe" + bio = "John Doe's true identity is unknown. Maybe he is a successful blogger or writer." + avatar = "img/avatar.png" + [Params] author = "John Doe" # Used in meta author. Optional description = "Responsive card-based & code-light Hugo theme" # Description of your site. Used in meta description @@ -87,6 +92,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id mainSections = ["post"] # Set main page sections post_meta = ["date", "categories"] # Enable post meta fields in given order dateFormat = "January 02, 2006" # Change the format of dates + authorbox = true # Show authorbox at bottom of single pages if true toc = true # Enable Table of Contents for all site pages tocOpen = true # Open Table of Contents block. Optional comments = true # Enable comments for all site pages diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a7a0bca..34d6d97 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,7 +8,6 @@ {{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }} - {{ with .Site.Params.author }}{{ end }} {{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }} {{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e1c2f2b..0f77667 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,6 +16,7 @@ + {{ partial "authorbox.html" . }} {{ partial "related.html" . }} {{ partial "comments.html" . }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/authorbox.html b/layouts/partials/authorbox.html new file mode 100644 index 0000000..8f51823 --- /dev/null +++ b/layouts/partials/authorbox.html @@ -0,0 +1,21 @@ +{{- if .Param "authorbox" }} +
+
+ {{- with .Site.Author.avatar }} +
+ {{ $.Site.Author.name }} avatar +
+ {{- end }} +
+
+ {{ .Site.Author.name }} +
+ {{- with .Site.Author.bio }} +
+ {{- . -}} +
+ {{- end }} +
+
+
+{{- end }} \ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css index 3823a17..73934d9 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -816,6 +816,30 @@ mark { text-align: center; } +/* Authorbox */ +.author { + display: flex; + align-items: flex-start; +} + +.author__avatar { + margin-right: .875rem; + margin-bottom: 0; +} + +.author__img { + border-radius: 50%; +} + +.author__body { + flex: 1; +} + +.author__name { + margin-bottom: .625rem; + font-weight: 700; +} + /* Comments */ .comments { margin-top: .625rem; diff --git a/static/img/avatar.png b/static/img/avatar.png new file mode 100644 index 0000000..c1eb30f Binary files /dev/null and b/static/img/avatar.png differ