From 597a631988526380e81061f778f85eff43653a5d Mon Sep 17 00:00:00 2001 From: diamon Date: Fri, 1 Oct 2021 20:11:40 +0300 Subject: [PATCH] add default author (#408) --- exampleSite/config.toml | 3 ++- layouts/_default/single.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9d6a04b..be77ee4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -27,6 +27,7 @@ enableRobotsTXT = true filename = "sitemap.xml" [params] + author = "" favicon = "" site_logo = "" description = "The last theme you'll ever need. Maybe." @@ -44,4 +45,4 @@ enableRobotsTXT = true # choose a background color from any on this page: http://tachyons.io/docs/themes/skins/ and preface it with "bg-" background_color_class = "bg-black" featured_image = "/images/gohugo-default-sample-hero-image.jpg" - recent_posts_number = 2 \ No newline at end of file + recent_posts_number = 2 diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cbb7e74..7cf01e2 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -18,7 +18,7 @@

{{- .Title -}}

- {{ with .Params.author }} + {{ with .Params.author | default .Site.Params.author }}

By {{ if reflect.IsSlice . }}