|
|
|
|
@ -1682,16 +1682,17 @@ disclosure /details/ to show in <span class=blue>blue</span>. |
|
|
|
|
#+html: <style>details summary { color: green; }</style> |
|
|
|
|
#+html: <style>details .details { color: blue; }</style> |
|
|
|
|
*** 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" |
|
|
|
|
|