Fix the site author-related templates

Also, format the files accordingly to the EditorConfig.
This commit is contained in:
Gabriel Arazas 2021-01-21 07:43:38 +08:00
parent 77a306a0f5
commit 6a29def8ee
8 changed files with 104 additions and 19 deletions

View File

@ -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

View File

@ -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.

View File

@ -15,4 +15,5 @@ base0B: "a1b56c"
base0C: "86c1b9"
base0D: "7cafc2"
base0E: "ba8baf"
base0F: "a16946"
base0F: "a16946"

View File

@ -42,4 +42,5 @@ font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,And
}
}
</style>
{{< /css.inline >}}
{{< /css.inline >}}

29
i18n/en.toml Normal file
View File

@ -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"

29
i18n/tl.toml Normal file
View File

@ -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"

View File

@ -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 }}
<span data-authors="{{ jsonify . }}">
{{- $names := slice }}
{{- range . }}{{ $names = $names | append .name }}{{ end }}
{{- $author := index (first 1 $names) 0 }}
<span data-authors="{{ jsonify $names }}">
{{ partial "components/heroicon.html" "pencil" }}
<span style="margin-left: 0.5em;">
{{ $author.name }}{{ if ge (len .) 2 }}, et al.{{ end }}
{{ $author }}{{ if ge (len .) 2 }}, et al.{{ end }}
</span>
</span>
{{ end }}
</div>
{{- end }}

View File

@ -43,16 +43,16 @@
{{- if $showNumber }}
<li>
<a class="page-link{{ if eq . $pag }}--active{{ end }}" href="{{ .URL }}"
{{- if eq (sub $pag.PageNumber .PageNumber) 1 }}
rel="prev"
aria-label="Previous"
{{- else if (eq (sub $pag.PageNumber .PageNumber) -1) }}
rel="next"
aria-label="Next"
{{- else if (eq $pag.PageNumber .PageNumber) }}
aria-label="Current"
aria-current="page"
{{- end -}}
{{- if eq (sub $pag.PageNumber .PageNumber) 1 }}
rel="prev"
aria-label="Previous"
{{- else if (eq (sub $pag.PageNumber .PageNumber) -1) }}
rel="next"
aria-label="Next"
{{- else if (eq $pag.PageNumber .PageNumber) }}
aria-label="Current"
aria-current="page"
{{- end -}}
>{{ .PageNumber }}</a>
</li>
{{- else if $shouldEllipse }}