From e36e557cb8a0b5a1e2bbd3894d72ed417ee06435 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Wed, 1 Aug 2018 13:25:32 -0400 Subject: [PATCH] Minor formatting edits to the previous commit --- doc/ox-hugo-manual.org | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/ox-hugo-manual.org b/doc/ox-hugo-manual.org index 191e573..61e1984 100644 --- a/doc/ox-hugo-manual.org +++ b/doc/ox-hugo-manual.org @@ -1682,16 +1682,17 @@ disclosure /details/ to show in blue. #+html: #+html: *** Author - :PROPERTIES: - :EXPORT_FILE_NAME: author - :END: -The =author= front-matter parameter is designed to always be a list, -so multiple authors can be supported. +:PROPERTIES: +:EXPORT_FILE_NAME: author +:END: +The =author= front-matter parameter is designed to always be a Slice +(list), so that multiple authors can be supported. -If you already have a blog, and in your font-matter =author= is set as -a *String*, you can use the following snippet: +If you already have a blog, and if the =author= front-matter already +exists, but set as a /String/, and not a /Slice of Strings/, you can +use the following snippet: -#+begin_src +#+begin_src go-html-template {{ with .Params.author }} {{ $author_type := (printf "%T" .) }} {{ $author_is_slice := (eq "[]string" $author_type) }} @@ -1705,18 +1706,18 @@ a *String*, you can use the following snippet: {{ end }} #+end_src -What the above code does: -- If the author front-matter parameter exists: - - If author is a slice (list), insert its first element, - - Else, insert it whole. +*What the above code does* --- -Other workaround could be to manually set the =author= param as a -String and not a slice: +If the =author= front-matter parameter exists: +- If =author= is of /Slice/ type, insert its first element, +- Else, insert it whole. + +An alternative would be to manually set the =author= param as a +/String/ and not a /Slice/: #+begin_src org -#+hugo_custom_front_matter: :author "foo bar" +#+hugo_custom_front_matter: :author "fname lname" #+end_src - ** Enhancements :PROPERTIES: :EXPORT_HUGO_MENU: :menu "6.enhancements"