diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..a3d7ac7 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,22 @@ + +{{ partial "head.html" . }} + + {{ partial "page_header.html" . }} + + +

{{ block "title" .}} + {{ .Title | title }} + {{- end }} +

+ + + {{ block "main" . }} + {{ .Content }} + + {{ end }} + + {{ block "footer" . }} + + {{ end }} + + diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..1979cab --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,15 @@ +{{/* layouts/_default/index.json */}} +{{- $index := slice -}} +{{- range where .Site.RegularPages.ByDate.Reverse "Type" "not in" (slice "page" "json") -}} + {{ if .Params.dateCreated }} + {{ $.Scratch.Set "date" (.Params.dateCreated) }} + {{ else }} + {{- if isset site.Params "date_format" -}} + {{- $.Scratch.Set "date" (.Date.Format site.Params.date_format) -}} + {{- else -}} + {{- $.Scratch.Set "date" (.Date.Format "2006-01-02") -}} + {{- end -}} + {{ end }} + {{- $index = $index | append (dict "title" ( .Title | plainify ) "permalink" .Permalink "section" (i18n (.Section | title)) "tags" (apply .Params.tags "i18n" "." ) "categories" (apply .Params.categories "i18n" "." ) "summary" (.Params.summary | markdownify | htmlUnescape | plainify) "date" ($.Scratch.Get "date") ) -}} +{{- end -}} +{{- $index | jsonify -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index a3e5868..1aba3ec 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,23 +1,19 @@ - - -{{ partial "head.html" . }} +{{ define "main" -}} - - {{ partial "page_header.html" . }} +{{ .Content }} + +{{- end }} -

Posts

- -
- - - {{ range .Pages.ByPublishDate }} -
- {{ .Title }}
- -
-
- {{ end }} -
- - - \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e6f7376..12c64b2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,13 +1,10 @@ - -{{ partial "head.html" . }} +{{ define "main" }} +

+

- -{{ partial "page_header.html" . }} -

{{ .Title }}

-

-

-{{ .Content }} + {{ .Content }} +{{ end }} -{{ partial "footer.html" . }} - - \ No newline at end of file +{{ define "footer" }} +{{partial "footer" .}} +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c85c218..165163e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,4 +1,5 @@ + {{ if not .IsHome }}{{ .Title | title }} | {{ end }}{{ .Site.Title }} @@ -12,4 +13,6 @@ integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> + {{ partialCached "search" . }} + diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html index 19ff6f4..23bf447 100644 --- a/layouts/partials/page_header.html +++ b/layouts/partials/page_header.html @@ -3,7 +3,6 @@