I’m building my theme from scratch. On some pages like blog posts, I want to show a summary. On some pages like projects and contact, I don’t want a summary because it makes no sense.
My front matter:
---
title: 'Projects'
date: 2024-02-24
lastmod: 2024-02-24
draft: true
tags: [ ]
summary: ""
---
The relevant part of single.html:
{{if not (eq .Summary "")}}
<p> {{ .Summary }}</p>
{{end}}
I know I can use ne, but this reads better for me
For the front matter above, shouldn’t the if statement be false? Rather, if summary is left empty, it instead uses the first few words of the remaining markdown. If I set summary to be empty, I don’t want it to show, at all.
From this page as well: Content summaries | Hugo, it seems hugo ALWAYS needs a summary, and it automatically gets one if it can’t find one
How can I get around this? I can replace ""
with " "
and just check for " "
instead but that just seems hacky. Is that my only option?
Thanks