From 2a89630a47358edd3351bd8ad90ab03bd507bd59 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sat, 24 Nov 2018 15:14:43 +0100 Subject: Add simple blog rendering --- layouts/posts/baseof.html | 20 ++++++++++++++++++++ layouts/posts/list.html | 20 ++++++++++++++++++++ layouts/posts/single.html | 11 +++++++++++ 3 files changed, 51 insertions(+) create mode 100644 layouts/posts/baseof.html create mode 100644 layouts/posts/list.html create mode 100644 layouts/posts/single.html (limited to 'layouts/posts') diff --git a/layouts/posts/baseof.html b/layouts/posts/baseof.html new file mode 100644 index 0000000..d147c1e --- /dev/null +++ b/layouts/posts/baseof.html @@ -0,0 +1,20 @@ + +{{- partial "docs/shared" -}} + + + + {{ partial "docs/html-head" . }} + {{ partial "docs/inject/head" . }} + + + +
+
+ {{ template "main" . }} +
+
+ {{ partial "docs/inject/body" . }} + + + + \ No newline at end of file diff --git a/layouts/posts/list.html b/layouts/posts/list.html new file mode 100644 index 0000000..4fda83f --- /dev/null +++ b/layouts/posts/list.html @@ -0,0 +1,20 @@ +{{ define "main" }} +
+ {{ $paginator := .Paginate (where .Pages "Params.hidden" "ne" true) }} + {{ range sort .Paginator.Pages }} +
+

+ {{ .Title }} +

+
{{ .Date.Format "January 2, 2006" }}
+

+ {{ .Summary }} + {{ if .Truncated }} + ... + {{ end }} +

+
+ {{ end }} + {{ template "_internal/pagination.html" . }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 0000000..f31b1a9 --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
{{ .Date.Format "January 2, 2006" }}
+
+
+ {{- .Content -}} +
+
+{{ end }} \ No newline at end of file -- cgit v1.2.3