From 6a29def8eea5c2b3167b8e4f239a9921ea44c4ff Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 21 Jan 2021 07:43:38 +0800 Subject: [PATCH] Fix the site author-related templates Also, format the files accordingly to the EditorConfig. --- CHANGELOG.adoc | 7 +++++ README.adoc | 23 ++++++++++++--- data/more-contentful/themes/_index.yaml | 3 +- .../content/en/articles/emoji-support.md | 3 +- i18n/en.toml | 29 +++++++++++++++++++ i18n/tl.toml | 29 +++++++++++++++++++ layouts/partials/components.html | 9 ++++-- layouts/partials/pagination.html | 20 ++++++------- 8 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 i18n/en.toml create mode 100644 i18n/tl.toml diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 3806b7a..8020345 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -31,6 +31,13 @@ For reference, it is from link:https://github.com/simple-icons/simple-icons/comm * Improve the list template to be more considerable to easy eyeing of the posts. +=== Fixed + +* Fix the site authors with its documentation. + +* Format the files correctly as specified from the EditorConfig file. + + == [0.1.3] - 2020-11-06 diff --git a/README.adoc b/README.adoc index f5f6f3e..089acd5 100644 --- a/README.adoc +++ b/README.adoc @@ -148,10 +148,13 @@ paginate = 20 path = "github.com/foo-dogsquared/hugo-web-feeds" -[author] - [john_doe] - name = "John Doe" - email = "johndoe@example.com" +[author.john_doe] + name = "John Doe" + email = "johndoe@example.com" + +[author.jane_doe] + name = "Jane Doe" + email = "jane_doe_1995@example.com" [languages] @@ -219,6 +222,18 @@ As hinted from the example configuration, the author site parameter (i.e., `$.Si The author object only requires a value for `name` key. You can also add more keys for more metadata. +.An example of indicating authors in the site configuration +[source, toml] +---- +[author.john_doe] + name = "John Doe" + email = "john_doe@example.com" + birthdate = "1996-01-12" + +[author.jane_doe] + name = "Jane Doe" +---- + Indicating the author(s) is also the same with content pages. For completeness and best practice, the author object should be structured with the following schema. diff --git a/data/more-contentful/themes/_index.yaml b/data/more-contentful/themes/_index.yaml index b150b08..602d34c 100644 --- a/data/more-contentful/themes/_index.yaml +++ b/data/more-contentful/themes/_index.yaml @@ -15,4 +15,5 @@ base0B: "a1b56c" base0C: "86c1b9" base0D: "7cafc2" base0E: "ba8baf" -base0F: "a16946" \ No newline at end of file +base0F: "a16946" + diff --git a/exampleSite/content/en/articles/emoji-support.md b/exampleSite/content/en/articles/emoji-support.md index 2cfd4a8..a3ce258 100644 --- a/exampleSite/content/en/articles/emoji-support.md +++ b/exampleSite/content/en/articles/emoji-support.md @@ -42,4 +42,5 @@ font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,And } } -{{< /css.inline >}} \ No newline at end of file +{{< /css.inline >}} + diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..eeb4719 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,29 @@ +# Content +[published_by] +other = "Authors" + +[published_on] +other = "Created" + +[updated_on] +other = "Updated" + +[available_translations] +other = "Translations" + +[table_of_contents] +other = "Table of contents" + + +# General +[and] +other = "and" + +[back_to_home] +other = "Back to home" + +[multilingual] +other = "Available in other languages" + +[page_not_found] +other = "Page not found" diff --git a/i18n/tl.toml b/i18n/tl.toml new file mode 100644 index 0000000..1420bb3 --- /dev/null +++ b/i18n/tl.toml @@ -0,0 +1,29 @@ +# Content +[published_by] +other = "Sinulat ni" + +[published_on] +other = "Na-publish noong" + +[updated_on] +other = "Binago noong" + +[available_translations] +other = "Mga pagsasalin" + +[table_of_contents] +other = "Talaan ng nilalaman" + + +# General +[and] +other = "at" + +[back_to_home] +other = "Balik sa homepage" + +[multilingual] +other = "Ibang lengwahe" + +[page_not_found] +other = "Hindi makita ang webpage na hinahanap mo" diff --git a/layouts/partials/components.html b/layouts/partials/components.html index 73f23da..cc0f916 100644 --- a/layouts/partials/components.html +++ b/layouts/partials/components.html @@ -69,13 +69,16 @@ If the partial is short enough, it should be put here. {{- /* The authors are appended with 'et al' if there's more than one author in the map. */ -}} {{ with .Params.author }} - {{ $author := index (first 1 .) 0 }} - + {{- $names := slice }} + {{- range . }}{{ $names = $names | append .name }}{{ end }} + {{- $author := index (first 1 $names) 0 }} + {{ partial "components/heroicon.html" "pencil" }} - {{ $author.name }}{{ if ge (len .) 2 }}, et al.{{ end }} + {{ $author }}{{ if ge (len .) 2 }}, et al.{{ end }} {{ end }} + {{- end }} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index d94f5df..9f40b31 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -43,16 +43,16 @@ {{- if $showNumber }}
  • {{- else if $shouldEllipse }}