baseURL: https://example.org/
+copyright: mo
languageCode: en-US
mainSections:
- blog
{{- define "title" }}
<h1>
- {{ .Title }}
- {{- if (.Param "ShowRssButtonInSectionTermList") }}
- {{- $rss := (.OutputFormats.Get "rss") }}
- {{- if (eq .Kind `page`) }}
- {{- $rss = (.Parent.OutputFormats.Get "rss") }}
- {{- end }}
- {{- with $rss }}
+ {{- with .OutputFormats.Get "rss" }}
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4"
stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9" />
<path d="M4 4a16 16 0 0 1 16 16" />
<circle cx="5" cy="19" r="1" />
</svg>
+ Archive of all Blog-Articles
</a>
- {{- end }}
- {{- end }}
</h1>
- {{- if .Description }}
- <div class="post-description">
- {{ .Description }}
- </div>
{{- end }}
{{- end }}{{/* end title */}}
{{- define "main" }}
-{{- range .Pages.GroupByPublishDate "2006" }}
-{{- if ne .Key "0001" }}
-<div class="archive-year">
- {{- $year := replace .Key "0001" "" }}
- <h2 class="archive-year-header" id="{{ $year }}">
- <a class="archive-header-link" href="#{{ $year }}">
- {{- $year -}}
- </a>
- </h2>
- {{- range .Pages.GroupByDate "January" }}
- <div class="archive-month">
- <div class="archive-posts">
- {{- range .Pages }}
- {{- if eq .Kind "page" }}
+{{- range .RegularPagesRecursive }}
<div class="archive-entry">
<h3 class="archive-entry-title entry-hint-parent">
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}">{{- .Title | markdownify }}</a>
{{- partial "post_meta.html" . -}}
</div>
</div>
- {{- end }}
- {{- end }}
- </div>
- </div>
- {{- end }}
-</div>
-{{- end }}
{{- end }}
{{- end }}{{/* end main */}}
--- /dev/null
+{{- $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 "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
+ <channel>
+ <title>{{ site.Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <description>{{ site.Description }}</description>
+ <generator>Hugo -- {{ hugo.Version }}</generator>
+ <language>{{ site.Language.LanguageCode }}</language>
+ <managingEditor>{{params.author.email}} ({{params.author.name}})</managingEditor>
+ <webMaster>{{params.author.email}} ({{params.author.name}})</webMaster>
+ <copyright>{{ . | markdownify | plainify | strings.TrimPrefix "© " }}</copyright>
+ <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
+ {{- with .OutputFormats.Get "RSS" }}
+ {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
+ {{- end }}
+ {{- range $pages }}
+ {{- if and (ne .Layout `search`) (ne .Layout `archives`) }}
+ <item>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+ {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
+ <guid>{{ .Permalink }}</guid>
+ <description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
+ {{- if and site.Params.ShowFullTextinRSS .Content }}
+ <content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
+ {{- end }}
+ </item>
+ {{- end }}
+ {{- end }}
+ </channel>
+</rss>