diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..35c95f5 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+
+ {{ partial "content.html" . }} +
+ {{ $parent := . }} + {{ $sorted_pages := sort .Site.Pages (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}} + {{ $valid_pages := where $sorted_pages ".Parent" "!=" nil }} + {{ $valid_pages := where $valid_pages ".Params.hide_in_list" "!=" "true" }} + {{ range where $valid_pages ".Parent.UniqueID" $parent.UniqueID }} + {{ partial "list_item.html" . }} + {{ end }} +
+
+{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4c4bdf5..dfd6ca8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,26 +1,7 @@ {{ define "main" }}
- {{ if .Params.image }} - - {{ end }} -

{{ .Title }}

-
{{ .Params.subtitle }}
-

- {{ .Date.Format "2006-01-02" }} - {{ range .Params.tags }} - - {{ . }} - - {{ end }} -

-
-
-
- {{ .TableOfContents }} -
- {{ .Content }} -
+ {{ partial "content.html" . }}
{{ end }} diff --git a/layouts/partials/content.html b/layouts/partials/content.html new file mode 100644 index 0000000..3af4094 --- /dev/null +++ b/layouts/partials/content.html @@ -0,0 +1,23 @@ +{{ if .Params.image }} + +{{ end }} +

{{ .Title }}

+
{{ .Params.subtitle }}
+

+ {{ if .Params.date }} + {{ .Date.Format "2006-01-02" }} + {{ end }} + + {{ range .Params.tags }} + + {{ . }} + + {{ end }} +

+
+
+
+ {{ .TableOfContents }} +
+ {{ .Content }} +
diff --git a/layouts/partials/list_item.html b/layouts/partials/list_item.html new file mode 100644 index 0000000..f4788ea --- /dev/null +++ b/layouts/partials/list_item.html @@ -0,0 +1,15 @@ +
+ {{ if .Params.image }} +
+ + {{ .Title }} image + +
+ {{ end }} +
+ +
{{ .Title }}
+
+

{{ .Summary }}

+
+
diff --git a/layouts/posts/list.html b/layouts/posts/list.html index 1878dde..616e74b 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -9,19 +9,7 @@ {{ range .Pages.ByDate }} -
-
- - {{ .Title }} image - -
-
- -
{{ .Title }}
-
-

{{ .Summary }}

-
-
+ {{ partial "list_item.html" . }} {{ end }} {{ end }}