Right, let’s talk about getting your words onto the page. You’ve got your content files written in beautiful, pristine Markdown. Hugo has dutifully parsed them. Now what? You need to actually render that content. This is where .Content and .Summary come in, and while they seem simple on the surface, they’re the very heart of your site’s engine. I’ve seen more than a few people trip over the nuances here, so pay attention.
The Workhorse: .Content Think of .Content as the main event. When you call .Content on a page object within a template, Hugo says, “Alright, you asked for it,” and serves up the entire rendered content of that page. It’s not the raw Markdown; it’s the final HTML, after all your shortcodes have been processed and your Markdown has been transformed. This is what you’ll slap into your single.html template to show the full blog post or product description.
Here’s the typical, no-frills usage:
<article class="prose prose-lg"> {{ .Content }} </article> Dead simple, right? But here’s the first “gotcha” everyone encounters: Hugo, in its infinite wisdom, has already wrapped your content in a <p> tag if it’s a paragraph, or the appropriate HTML element. This means if you write a Markdown file that’s just Hello, world!, calling .Content gives you <p>Hello, world!</p>. This is mostly fine until you try to do something clever like wrap it in another element and your HTML structure gets weird. The solution is to understand that .Content is a pre-rendered HTML block, not a string you can easily manipulate with Go template functions. You work around it, not with it.
The Art of the Tease: .Summary Now, .Summary is a different beast entirely. Its job is to give you a preview, a snippet to use on listing pages without giving away the whole farm. By default, Hugo calculates the summary as the first 70 words of your content, *but only up to the first occurrence of the `