diff --git a/archetypes/section/_index.md b/archetypes/section/_index.md index 6543fa9..bf88c68 100644 --- a/archetypes/section/_index.md +++ b/archetypes/section/_index.md @@ -1,4 +1,5 @@ --- linkTitle: "{{ .File.ContentBaseName | humanize | lower }}" title: "{{ .File.ContentBaseName | humanize }}" +outputs: [html] --- diff --git a/init/hugo.yaml b/init/hugo.yaml index edc46ad..d893a19 100644 --- a/init/hugo.yaml +++ b/init/hugo.yaml @@ -1,6 +1,6 @@ theme: yrzam -# SITE INFO +# SITE SETTINGS baseURL: title: languageCode: @@ -8,9 +8,8 @@ taxonomies: # Create these per each section&taxo, replacing section # with section name and taxo with taxonomy name section_taxo: section/taxo - -# SITE SETTINGS params: + email: dateFormat: "2006-01-02T15:04:05Z" dateFormatShort: "2006-01-02" paginationAdjacentLinks: 2 @@ -19,6 +18,14 @@ paginate: 50 # GENERATOR SETTINGS capitalizeListTitles: false disableHugoGeneratorInject: true -disableKinds: [RSS, sitemap, taxonomy] +disableKinds: [sitemap] +outputs: + home: [html] + section: [html, rss] + taxonomy: [] + term: [html] +outputFormats: + RSS: + baseName: rss minify: - minifyOutput: true \ No newline at end of file + minifyOutput: true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index dfd1cc6..ddc68f1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,12 +4,15 @@ - {{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }} + {{ if not .IsHome }}{{ .LinkTitle | humanize }} - {{ end }}{{ .Site.Title }} {{ $opts := dict "transpiler" "libsass" "targetPath" "style.css" }} {{ with resources.Get "css/index.scss" | toCSS $opts | minify | fingerprint }} {{ end }} + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} + {{ end }} {{ block "body" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1c662dd..0543bf0 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -34,7 +34,9 @@ {{- end -}} {{ define "footer" }} - +
+ {{ with .OutputFormats.Get "rss" -}} + {{ printf `subscribe` .Rel .Permalink | safeHTML }} + {{ end -}} +
{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..0c5ad72 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,36 @@ + +{{- $pctx := . -}} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ .Site.Title }}{{ if not .IsHome }}: {{ .LinkTitle | humanize }}{{ end }} + {{ .Permalink }} + {{ site.Language.LanguageCode }}{{ if site.Params.email }} + {{ site.Params.email }}{{ end }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ if site.Params.email }} + {{ site.Params.email }}{{ end }} + {{ .Permalink }} + {{ .Content | transform.XMLEscape | safeHTML }} + + {{- end }} + + \ No newline at end of file