summaryrefslogtreecommitdiff
path: root/layouts/posts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/posts')
-rw-r--r--layouts/posts/list.html22
-rw-r--r--layouts/posts/list.xml37
-rw-r--r--layouts/posts/single.html36
3 files changed, 95 insertions, 0 deletions
diff --git a/layouts/posts/list.html b/layouts/posts/list.html
new file mode 100644
index 0000000..b5ec8ca
--- /dev/null
+++ b/layouts/posts/list.html
@@ -0,0 +1,22 @@
+{{- define "main" }}
+<h1>{{ .Title }}</h1>
+{{ .Content }}
+{{- range .Sections }}
+ <h2>{{ .Title }}</h2>
+ <ul>
+ {{- range .Pages }}
+ <li>
+ <a class="u-url" href="{{ .Permalink }}"><span class="p-name">{{ .Title }}</span></a>
+ <small>
+ <time class="dt-published" datetime="{{ .Date | dateFormat "2006-01-02" }}">
+ {{ .Date | dateFormat "2006-01-02" }}
+ </time>
+ {{- range .Params.tags }}
+ <a class="p-category tag" href="/tags/{{ . | lower }}">{{ . }}</a>
+ {{- end }}
+ </small>
+ </li>
+ {{- end }}
+ </ul>
+{{- end }}
+{{- end }}
diff --git a/layouts/posts/list.xml b/layouts/posts/list.xml
new file mode 100644
index 0000000..deb2448
--- /dev/null
+++ b/layouts/posts/list.xml
@@ -0,0 +1,37 @@
+{{- $pctx := . -}}
+{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
+{{- $pages := slice -}}
+{{- range .Sections.Reverse -}}
+{{- $pages = (append $pages (where .RegularPages "Draft" false)) }}
+{{- 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">
+ <channel>
+ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+ <link>{{ .Permalink }}</link>
+ <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
+ <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
+ <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
+ <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
+ <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
+ <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
+ <lastBuildDate>{{ .Date.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 }}
+ <item>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+ {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
+ <guid>{{ .Permalink }}</guid>
+ <description>{{ .Content | html }}</description>
+ </item>
+ {{ end }}
+ </channel>
+</rss>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
new file mode 100644
index 0000000..eca87b9
--- /dev/null
+++ b/layouts/posts/single.html
@@ -0,0 +1,36 @@
+{{ define "main" }}
+<article class="h-entry">
+ <header>
+ <h1 class="p-name">{{ .Title }}</h1>
+ <p>
+ {{- range .Params.tags }}
+ <a class="p-category tag" href="/tags/{{ . | lower }}">{{ . }}</a>
+ {{- end }}
+ &mdash; Published on <time class="dt-published" datetime="{{ .Date | dateFormat "2006-01-02" }}">{{ .Date | dateFormat "2006-01-02" }}</time>.
+ </p>
+ {{- if .Draft }}
+ <section class="admonition">
+ <div class="admonition-title">
+ draft
+ </div>
+ <div class="admonition-content">
+ This blog post is still a
+ <strong>draft</strong>. It has most likely been
+ shared with you for reviewing purposes. Please
+ do not yet share this with other people.
+ </div>
+ </section>
+ {{- end }}
+ </header>
+ <main class="e-content">
+ {{ .Content }}
+ </main>
+ <footer>
+ <p class="text-center">
+ <a class="image-link" rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
+ <img alt="Creative Commons License" src="/img/cc-by-sa.png">
+ </a>
+ </p>
+ </footer>
+</article>
+{{ end }}