diff --git a/README.md b/README.md index 24960dc80..ca666013a 100644 --- a/README.md +++ b/README.md @@ -549,10 +549,12 @@ summaryLength = 70 title = "From our blog" subtitle = "Pellen" hide_summary = false + hide_image = false ``` Recent posts use `.Summary` property and by default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting summaryLength in your site configuration. When setting the `hide_summary` configuration property to `true` the summary will be hidden on the recent posts as well as the blogs list page. +And also if you set `hide_image` configuration property to `true` the image will be hidden like `hide_summary`. #### Footer @@ -569,11 +571,12 @@ A text can be defined, in case there is no text defined the entire block will be ##### Recent posts -Recent posts block can be enabled or disabled (hidden). +Recent posts block can be enabled or disabled (hidden). And you can use `hide_iamge` for `Recent posts` block on footer. ```toml [params.footer.recent_posts] enable = true + hide_image = false ``` ##### Contact diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 51fd46a9a..e2872020f 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -541,9 +541,11 @@ pluralizelisttitles = false title = "From our blog" subtitle = "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo." hide_summary = false + hide_image = false [params.footer.recent_posts] enable = true + hide_image = false [taxonomies] category = "categories" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4bfe2069c..9f14b5dd3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -27,6 +27,7 @@ {{ range $paginator.Pages }}
+ {{ if not (default false .Site.Params.recent_posts.hide_image) }}
-

{{ .Title }}

+ {{ else }} +
+ {{ end }} +

{{ .Title }}

{{ if isset .Params "authors" }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 30b0842af..a2c3af650 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -21,6 +21,7 @@

{{ i18n "recentPosts" }}

{{ range first 3 (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
+ {{ if not (default false .Site.Params.footer.recent_posts.hide_image) }} + {{ end }} diff --git a/layouts/partials/recent_posts.html b/layouts/partials/recent_posts.html index 5add1e877..50775a13d 100644 --- a/layouts/partials/recent_posts.html +++ b/layouts/partials/recent_posts.html @@ -19,6 +19,7 @@

{{ .Site.Params.recent_posts.title | markdownify }}

{{ range first 4 $posts.Pages }}
+ {{ if not (default false .Site.Params.recent_posts.hide_image) }}
{{ if isset .Params "banner" }} @@ -34,6 +35,7 @@

{{ .Site.Params.recent_posts.title | markdownify }}

+ {{ end }}