diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100755 index 0000000..9fdc817 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,73 @@ +{{ define "header" }} + {{/* We can override any block in the baseof file be defining it in the template */}} + {{ partial "page-header.html" . }} +{{ end }} + +{{ define "main" }} + {{ $section := .Site.GetPage "section" .Section }} +
+
+ + {{ partial "social-share.html" . }} +

+ {{- .Title -}} +

+ {{ with .Params.author }} +

+ By + {{ if reflect.IsSlice . }} + {{ delimit . ", " | markdownify }} + {{else}} + {{ . | markdownify }} + {{ end }} + +

+ {{ end }} + {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} + + + {{/* + Show "reading time" and "word count" but only if one of the following are true: + 1) A global config `params` value is set `show_reading_time = true` + 2) A section front matter value is set `show_reading_time = true` + 3) A page front matter value is set `show_reading_time = true` + */}} + {{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}} + - {{ .ReadingTime}} minutes read + - {{ .WordCount}} words + {{ end }} + {{ if .Site.Params.commentoEnable }} + + - Comments + + {{ end }} +
+
+ {{- .Content -}} + {{- partial "tags.html" . -}} +
+ {{ if and (.Params.comments) (eq .Section "post") }} + {{ if .Site.DisqusShortname }} + {{ template "_internal/disqus.html" . }} + {{ end }} + {{ if .Site.Params.commentoEnable }} + {{- partial "commento.html" . -}} + {{ end }} + {{ end }} +
+
+ + + +
+{{ end }} diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html new file mode 100644 index 0000000..9272d4d --- /dev/null +++ b/layouts/partials/page-header.html @@ -0,0 +1,26 @@ +{{ $featured_image := partial "func/GetFeaturedImage.html" . }} +{{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} + {{ $featured_image := (trim $featured_image "/") | absURL }} +
+
+ {{ partial "site-navigation.html" . }} +
+ {{ if not .Params.omit_header_text }} +

{{ .Title | default .Site.Title }}

+ {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} + {{ end }} +
+
+
+{{ else }} +
+
+ {{ partial "site-navigation.html" . }} +
+
+{{ end }}