We can use .Content
page variable to access Markdown content.
Version
Hugo 0.91
Page
The page displays content from Markdown.
Markdown
content/_index.md
---
title: My Blog
description: Hello World
subtitle: Page Subtitle
---
## Overview
![home](home.jpg)
This is my first blog.
Line 6
## Overview
![home](home.jpg)
This is my first blog.
The content is written by Markdown.
Layout
layouts/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="alpine.js" defer></script>
<link rel="stylesheet" href="output.css" />
</head>
<body>
{{ .Content }}
</body>
</html>
Line 10
{{ .Content }}
.Content
: default page variable to access Markdown content
Conclusion
- Hugo automatically runs
.Content
through the Markdown parser and provides a string to place directly in the document