This template demonstrates all standard Markdown features to help test Hugo theme rendering.

Headers

H1 Header

H2 Header

H3 Header

H4 Header

H5 Header
H6 Header

Text Formatting

Bold text and also bold

Italic text and also italic

Bold and italic and also bold and italic

Strikethrough text

Regular text with inline code formatting.

Lists

Unordered Lists

  • First item
  • Second item
    • Nested item
    • Another nested item
      • Deeply nested item
  • Third item

Ordered Lists

  1. First ordered item
  2. Second ordered item
    1. Nested ordered item
    2. Another nested ordered item
      1. Deeply nested ordered item
  3. Third ordered item

Mixed Lists

  1. Ordered item
    • Unordered nested item
    • Another unordered nested item
  2. Another ordered item
    1. Nested ordered item
    • Mixed with unordered

Simple link

Link with title

Reference link

Autolink: https://example.com

Email autolink: user@example.com

Images

Alt text

Alt text with title

Reference image: Reference image

Code

Inline Code

Use the hugo server command to start your development server.

Variables like {{ .Title }} are common in Hugo templates.

Code Blocks

Plain code block without syntax highlighting
This is useful for simple text or pseudo-code
<!DOCTYPE html>
<html>
<head>
    <title>{{ .Title }}</title>
</head>
<body>
    <h1>{{ .Title }}</h1>
    <p>{{ .Content }}</p>
</body>
</html>
.header {
    background-color: #333;
    color: white;
    padding: 1rem;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}
function initTheme() {
    const theme = localStorage.getItem('theme') || 'light';
    document.body.classList.add(`theme-${theme}`);
}

// Hugo often uses this pattern for theme switching
document.addEventListener('DOMContentLoaded', initTheme);
package main

import (
    "fmt"
    "log"
    "net/http"
)

func main() {
    http.HandleFunc("/", handler)
    log.Fatal(http.ListenAndServe(":8080", nil))
}

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello, Hugo theme tester!")
}
# Since you're a Rails developer, here's some Ruby
class Post < ApplicationRecord
  validates :title, presence: true
  validates :content, presence: true, length: { minimum: 10 }

  scope :published, -> { where(published: true) }
  scope :recent, -> { order(created_at: :desc) }
end
# Hugo common commands
hugo new site my-site
cd my-site
git init
git submodule add https://github.com/theme/repo.git themes/theme-name
hugo server --buildDrafts --buildFuture

Blockquotes

This is a simple blockquote.

This is a blockquote with multiple paragraphs.

This is the second paragraph in the blockquote.

Blockquotes can contain headers

  1. And lists
  2. Like this one
And even code blocks

Nested Blockquotes

This is the first level of quoting.

This is nested blockquote.

And this is a third level.

Back to the first level.

Horizontal Rules

Three or more hyphens:


Three or more asterisks:


Three or more underscores:


Line Breaks

This line has two spaces at the end So this line appears on a new line.

This line has a backslash at the end
So this line also appears on a new line.

This line has no special ending So this line continues on the same line in most renderers.

Escape Characters

*This text is not italic*

`This is not code`

[This is not a link](https://example.com)

# This is not a header

Special Characters

Characters that often need testing:

  • Ampersand: AT&T
  • Less than: 4 < 5
  • Greater than: 5 > 4
  • Quotes: “Hello” and ‘World’
  • Apostrophe: don’t, won’t, it’s
  • En dash: pages 5–10
  • Em dash: Hugo is fast—really fast
  • Ellipsis: Loading…
  • Copyright: © 2024
  • Trademark: Hugo™

Hugo-Specific Elements

While not standard Markdown, these are common in Hugo:

Front Matter Example

---
title: "Test Post"
date: 2024-01-01T00:00:00Z
draft: false
categories: ["development"]
---

Extended Markdown Features

Many Hugo themes support extended Markdown features:

Footnotes

Here’s a sentence with a footnote1.

Here’s another sentence with a footnote2.

Definition Lists

Term 1
Definition 1
Term 2
Definition 2a
Definition 2b

Abbreviations

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium


Testing Notes

This template covers:

  • All standard Markdown syntax
  • Common Hugo use cases
  • Various text formatting scenarios
  • Different content types (text, code, images, tables)
  • Special characters and edge cases
  • Extended Markdown features

Use this file to verify that your Hugo theme properly renders all Markdown elements with consistent styling and appropriate spacing.


  1. This is the first footnote. ↩︎

  2. This is the second footnote with more content. ↩︎