diff --git a/config/_default/params.toml b/config/_default/params.toml index b49fefa..2368c3d 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -3,6 +3,7 @@ usePageBundles = true description = "while (true) { bugs++; }" mainSections = ["posts"] fallBackOgImage = "images/broken-computer.svg" +numberOfFeaturedPosts = 5 # Comments comments = true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..02dc4a9 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,36 @@ + + + + + {{- partial "head.html" . -}} + + + +
+ + + +
+ {{- block "main" . }}{{- end }} +
+ +
+
+ {{- partial "about.html" . -}} +
+
+
+ {{- partial "aside" . }} +
+
+ + + +
+ + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 76758dd..a0af61c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,10 +3,6 @@

{{ .Title | markdownify }}

- {{ if .Params.toc }} - - {{ end }} {{- with .Param "lastmod" -}} {{- $ageDays = div (sub now.Unix .Unix) 86400 -}} {{- end -}} @@ -31,19 +27,3 @@ {{- end }} {{ 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 }} - - {{ if and (.Params.toc) (gt .WordCount 400 ) (gt (len .TableOfContents) 180) (.TableOfContents) }} -
- On this page: - {{ .TableOfContents }} - {{ end }} -{{ end }} diff --git a/layouts/partials/aside.html b/layouts/partials/aside.html new file mode 100644 index 0000000..e799135 --- /dev/null +++ b/layouts/partials/aside.html @@ -0,0 +1,27 @@ +{{ 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 }} + +{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }} +
+

On this page

+ {{ .TableOfContents }} +{{ end }} + +{{- $posts := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} +{{- $featured := default 8 .Site.Params.numberOfFeaturedPosts }} +{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}} +{{- with $featuredPosts }} +

Featured Posts

+ +{{- end }}