diff --git a/i18n/en.toml b/i18n/en.toml index 3761fbb..bf260c4 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -27,6 +27,9 @@ other = "Translations" # General +[and] +other = "And" + [back_to_home] other = "Back to home" diff --git a/i18n/tl.toml b/i18n/tl.toml index 4fd1840..9293def 100644 --- a/i18n/tl.toml +++ b/i18n/tl.toml @@ -27,6 +27,9 @@ other = "Mga pagsasalin" # General +[and] +other = "At" + [back_to_home] other = "Balik sa homepage" diff --git a/layouts/_default/list.atom b/layouts/_default/list.atom index 2de4e17..99225c7 100644 --- a/layouts/_default/list.atom +++ b/layouts/_default/list.atom @@ -1,29 +1,49 @@ +{{- /* This template was based from the Atom syndication format at IETF RFC #4287 (https://tools.ietf.org/html/rfc4287). */ -}} {{ printf "" | safeHTML }} - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}{{ with .Site.Params.Subtitle }} - {{ . | safeHTML }}{{ end }} - - - {{ with .Site.Copyright }}{{ . }}{{ else }}© {{ now.Year }} {{ $.Site.Author.name }}{{ end }} + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + + {{- range .AlternativeOutputFormats }} + {{- printf "" .Rel .MediaType .Permalink | safeHTML }} + {{- end }} + {{ with .Site.Copyright }}{{ . }}{{ else }}© {{ now.Year }} {{ with .Site.Author.name }}{{ . }}{{ end }}{{ end }} Hugo -- gohugo.io {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} + + {{ with .Site.Author }} - {{ .Site.Author.name }}{{ with .Site.Author.email }} - {{ . }}{{ end }} + {{ .name }} + {{ with .email }}{{ . }}{{ end }} + {{ end }} {{ .Permalink }} + + {{- /* Generate each valid regular pages (with as an individual entry in the feed. */ -}} {{ $limit := cond (gt .Site.Params.feedLimit 0) .Site.Params.feedLimit 10 }} - {{ range first $limit (where .RegularPages "File.Dir" "!=" "/") }} + {{ range first $limit (where .Site.RegularPages ".Params.date" "!=" nil) }} {{ .Permalink }} {{ .Title }} - {{ with .Params.author }} - {{ . }}{{ end }}{{ range .Params.tags }} - {{ end }} + + + {{- range .Params.author }} + + {{ .name }}{{ with .email }} + {{ . }}{{ end }} + + {{- end }} + + {{- range .Params.tags }} + + {{- end }} {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} - {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ with .Params.license }} - {{ . | safeHTML }}{{ end }} + {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }} + + {{ with .Params.copyright }} + {{ . | safeHTML }} + {{ end }} + {{ .Content | html }} {{ end }} - \ No newline at end of file + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c503765..b16953e 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -12,22 +12,22 @@ {{ .Date.Format "2006-01-02" }} {{ end }} + {{ end }} diff --git a/layouts/_default/list.json b/layouts/_default/list.json index c1921b8..298088b 100644 --- a/layouts/_default/list.json +++ b/layouts/_default/list.json @@ -6,15 +6,20 @@ "description": "Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}", "favicon": "{{ "assets/icon.png" | absURL }}", "icon": "{{ "assets/icon.png" | absURL }}", + {{- with .Site.Author }} "author": { - "name": "{{ with .Site.Author.name }}{{ . }}{{ end }}" + "name": "{{ .name }}" + {{- with .email }}, + "url": "mailto:{{ . }}" + {{ end }} }, + {{- end }} "items": {{- $limit := cond (gt .Site.Params.feedLimit 0) .Site.Params.feedLimit 10 -}} - {{- $pages := first $limit (where .RegularPages "File.Dir" "!=" "/") -}} + {{- $pages := first $limit (where .Site.RegularPages "Params.date" "!=" nil) -}} {{- $.Scratch.Add "index" slice -}} {{- range $pages -}} - {{- $.Scratch.Add "index" (dict "id" .Permalink "url" .Permalink "title" .Title "summary" .Summary "content_html" .Content "tags" .Params.tags "date_published" (.Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML) "date_modified" ( .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML ) ) -}} + {{- $.Scratch.Add "index" (dict "id" .Permalink "url" .Permalink "title" .Title "summary" .Summary "content_html" .Content "tags" .Params.tags "date_published" (.Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML) "date_modified" ( .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML ) ) -}} {{- end -}} {{- $.Scratch.Get "index" | jsonify -}} -} \ No newline at end of file +} diff --git a/layouts/_default/list.rss b/layouts/_default/list.rss index a2e0440..dc4df8a 100644 --- a/layouts/_default/list.rss +++ b/layouts/_default/list.rss @@ -1,30 +1,61 @@ +{{- /* +The reference used to create this template is at https://cyber.harvard.edu/rss/rss.html. +The template does miss out on certain things which I put it on a list for those who are interested: + * Since there's no standard for multiple authors (with ) in the element, I decided it would be best to leave it out for now. + * The name was left out for certain elements that requires an email address (like , , or in the . + * is a permalink to the HTML post. + * No . + * contains the whole post; if you want to change it to and make a summarized version, refer to https://www.rssboard.org/rss-profile and change the description tag with `.Summary | safeHTML`. +*/ -}} {{ printf "" | safeHTML }} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ with .Site.Copyright }}{{ . }}{{ else }}© {{ now.Year }} {{ $.Site.Author.name }}{{ end }}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + Hugo -- gohugo.io + + {{ with .Site.LanguageCode }} + {{.}} + {{end}} + + {{ with .Site.Author.email }} + {{.}} + {{.}} + {{end}} + + {{ with .Site.Copyright }}{{ . }}{{ else }}© {{ now.Year }} to the author(s) behind {{ .Site.Title }}{{ end }} + + {{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ end }} + https://cyber.harvard.edu/rss/rss.html + {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} + + {{- /* Point the alternative output formats. */ -}} + {{ range .AlternativeOutputFormats }} + {{ printf "" .Permalink .Rel .MediaType | safeHTML }} + {{ end }} + + {{- /* Iterate each valid regular page. */ -}} {{ $limit := cond (gt .Site.Params.feedLimit 0) .Site.Params.feedLimit 10 }} - {{ range first $limit (where .RegularPages "File.Dir" "!=" "/") }} + {{ range first $limit (where .Site.RegularPages ".Params.date" "!=" nil) }} {{ .Title }} - {{ .Permalink }}{{ range .Params.tags }} - {{ . }}{{ end }} + {{ .Permalink }} + + {{ range .Params.tags }} + {{ . }} + {{ end }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Content | html }} {{ end }} - \ No newline at end of file + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6112206..5ad5a56 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,11 +6,16 @@