diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b4bc8dedb..713192f23 100755 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -6,7 +6,7 @@
{{ range .Paginator.Pages }}
- {{- partial "summary.html" . -}} + {{ .Render "summary" }}
{{ end }}
diff --git a/layouts/_default/summary-with-image.html b/layouts/_default/summary-with-image.html new file mode 100644 index 000000000..94666dbb3 --- /dev/null +++ b/layouts/_default/summary-with-image.html @@ -0,0 +1,29 @@ +{{ $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 }} +
+ + image from {{ .Title }} + +
+ {{ end }} +
+

+ + {{ .Title }} + +

+ + {{ $.Param "read_more_copy" | default (i18n "readMore") }} + {{/* TODO: add author +

By {{ .Author }}

*/}} +
+
+
+
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html new file mode 100644 index 000000000..fb7740457 --- /dev/null +++ b/layouts/_default/summary.html @@ -0,0 +1,13 @@ +
+
+ {{ humanize .Section }} +

+ + {{ .Title }} + +

+ +
+
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index e448fcace..31560f1c8 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -14,7 +14,7 @@

{{ range $value.Pages }} - {{ partial "summary.html" . }} + {{ .Render "summary" }} {{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 2fbe6cd77..2e51d10e5 100755 --- a/layouts/index.html +++ b/layouts/index.html @@ -26,7 +26,7 @@

{{/* Range through the first $n_posts items of the section */}} {{ range (first $n_posts $section) }}
- {{ partial "summary-with-image.html" . }} + {{ .Render "summary-with-image" }}
{{ end }} diff --git a/layouts/partials/func/warn.html b/layouts/partials/func/warn.html new file mode 100644 index 000000000..b2699062c --- /dev/null +++ b/layouts/partials/func/warn.html @@ -0,0 +1,15 @@ +{{/* + warn + Emits a warning using the theme's Header. + + @author @regisphilibert + + @context String + + @access private + + @example - Go Template + {{ partial "func/warn" $message }} +*/}} +{{ $header := "Ananke Theme Warning" }} +{{ warnf "\n%s:\n%s" $header . }} \ No newline at end of file diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html index 94666dbb3..b73f698d7 100644 --- a/layouts/partials/summary-with-image.html +++ b/layouts/partials/summary-with-image.html @@ -1,3 +1,6 @@ +{{ partial "func/warn" `You are currently using 'partial "summary-with-image"' in your project templates. +You should replace it with '.Render "summary-with-image"' as the use of this partial will be deprecated in future releases. +More info here: https://github.com/theNewDynamic/gohugo-theme-ananke/releases/tag/v2.8.1` }} {{ $featured_image := partial "func/GetFeaturedImage.html" . }}
diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html index d9cd9c68f..0c1a0d626 100644 --- a/layouts/partials/summary.html +++ b/layouts/partials/summary.html @@ -1,3 +1,6 @@ +{{ partial "func/warn" `You are currently using 'partial "summary"' in your project templates. +You should replace it with '.Render "summary"' as the use of this partial will be deprecated in future releases. +More info here: https://github.com/theNewDynamic/gohugo-theme-ananke/releases/tag/v2.8.1` }}
{{ humanize .Section }} diff --git a/layouts/post/list.html b/layouts/post/list.html index 5d0524079..f6cf4bd06 100644 --- a/layouts/post/list.html +++ b/layouts/post/list.html @@ -9,9 +9,6 @@