curtiscde / hugo-theme-massively

Massively theme for Hugo static site generator
https://hugo-theme-massively.netlify.app
Other
155 stars 138 forks source link

If post has no description, use the summary instead #83

Closed Kaligule closed 4 years ago

Kaligule commented 4 years ago

The summary is generated automatically by hugo. This could make transitioning to massively from a theme that doesn't require descriptions of posts much easier.

Kaligule commented 4 years ago

@curtistimson No problem, time is precious :)

I think both of your points are answered in the linked documentation: https://gohugo.io/content-management/summaries/

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.

So this is more for lazy people (like me) who tend not to spend time on writting their own descriptions. Or for those that switched from another theme that doesn't have descriptions as a field.

  1. Descriptions are specific to this theme, Summaries are a concept from Hugo itself.
  2. I can imagine posts where the summary is an empty string: Posts that consist of one or more images but don't have text. But hugo-theme-massively doesn't lend itself easily to such posts as far as I can see, so I find it unlikely that this might be a problem. Even then, there would just be an empty paragraph.

If you want then I will adjust the Pull Request according to your suggestions in point 2. I don't think it is necessary, though.

curtiscde commented 4 years ago

Thanks @Kaligule, changes have been approved and merged :)