diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f91cdb0..d113c49 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,12 +1,4 @@ {{ define "main" }} -

{{ .Title | markdownify }}

- - {{ .Content }} - - - + {{ partial "title_and_desc.html" . }} + {{ partial "postlist.html" . }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4dc326a..0ba14d8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,12 +8,3 @@ {{ end }} -{{define "aside" }} - {{ if .Params.description }}

{{ .Params.description }}

{{ end }} - {{ if or (.Params.author) (.Params.date) }} -

- {{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} - {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }} -

- {{ end }} -{{ end }} diff --git a/layouts/index.html b/layouts/index.html index c346e42..7076542 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,4 +1,5 @@ {{ define "main" }} - {{ .Content }} + {{ partial "title_and_desc.html" . }} + {{ partial "postlist.html" . }} {{ end }} diff --git a/layouts/partials/asside.html b/layouts/partials/asside.html new file mode 100644 index 0000000..58f24e7 --- /dev/null +++ b/layouts/partials/asside.html @@ -0,0 +1,9 @@ +{{define "aside" }} + {{ if .Params.description }}

{{ .Params.description }}

{{ end }} + {{ if or (.Params.author) (.Params.date) }} +

+ {{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} + {{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }} +

+ {{ end }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a2e54dc..0468397 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,2 +1 @@ - diff --git a/layouts/partials/postlist.html b/layouts/partials/postlist.html new file mode 100644 index 0000000..714ea05 --- /dev/null +++ b/layouts/partials/postlist.html @@ -0,0 +1,13 @@ +{{ range .Pages }} + {{ if not (isset .Params "hide") }} +
+
+

{{ .Title | markdownify }}

+
+ +
+ {{ .Description }} +
+
+ {{ end }} +{{ end }} diff --git a/layouts/partials/sectionlist.html b/layouts/partials/sectionlist.html new file mode 100644 index 0000000..090e6d5 --- /dev/null +++ b/layouts/partials/sectionlist.html @@ -0,0 +1,13 @@ +{{ range .Sections }} + {{ if not (isset .Params "hide") }} +
+
+

{{ .Title | markdownify }}

+
+ +
+ {{ .Description }} +
+
+ {{ end }} +{{ end }} diff --git a/layouts/partials/title_and_content.html b/layouts/partials/title_and_content.html new file mode 100644 index 0000000..757dd5d --- /dev/null +++ b/layouts/partials/title_and_content.html @@ -0,0 +1,4 @@ +
+

{{ .Title | markdownify }}

+{{ .Content }} +
diff --git a/layouts/partials/title_and_desc.html b/layouts/partials/title_and_desc.html new file mode 100644 index 0000000..1d635d2 --- /dev/null +++ b/layouts/partials/title_and_desc.html @@ -0,0 +1,4 @@ +
+

{{ .Title | markdownify }}

+{{ .Description }} +