Front Matter

Contents â–¾

This document outlines all available frontmatter parameters for the Sans Hugo theme.

Basic Parameters

Title and Date

YAML
1
2
3
4
---
title: "Your Post Title"
date: 2024-01-15T10:30:00-07:00
---

Page Type

YAML
1
type: "page"  # or "post"

Cover Image Configuration

Configure cover images for your posts using the cover parameter:

YAML
1
2
3
4
5
6
cover:
  image: "cover.jpg"
  alt: "Alternative text description"
  caption: "Photo by John Doe"
  imageDisplay: true
  captionDisplay: true

Example Usage

Full cover with caption:

YAML
1
2
3
4
cover:
  image: "featured.jpg"
  alt: "Mountain landscape at sunset"
  caption: "Photo taken at Rocky Mountain National Park"

Hide cover image:

YAML
1
2
3
cover:
  image: "cover.jpg"
  imageDisplay: false

Show image without caption:

YAML
1
2
3
4
cover:
  image: "cover.jpg"
  caption: "This caption won't be displayed"
  captionDisplay: false

Metadata Display Control

Show/Hide All Metadata

YAML
1
showFrontMatter: true

Note: This parameter overrides individual metadata settings below. If not specified, it defaults to the site-wide configuration in config.toml.

Taxonomies

Add taxonomical information to organize your content:

YAML
1
2
3
tags: ["hugo", "web-development", "tutorial"]
categories: ["Technology", "Programming"]
authors: ["John Doe"]

Table of Contents

YAML
1
toc: true

The table of contents is automatically generated from your heading structure.

Site-Wide Settings

The following parameters are typically configured in your config.toml file but can be overridden per post if needed:

Metadata Display

YAML
1
2
3
4
5
6
showTags: true
showCategories: true
showAuthors: true
showDate: true
showWordCount: true
showReadingTime: true

Taxonomy Clouds

YAML
1
2
3
showTagCloud: true
showCategoryCloud: true
showAuthorCloud: true

These control the sidebar taxonomy clouds that appear on desktop views.

Complete Example

Here’s a full example with all available frontmatter options:

YAML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
title: "Building Modern Websites with Hugo"
date: 2024-11-27T14:30:00-07:00
tags: ["hugo", "static-site-generator", "web-development"]
categories: ["Technology", "Tutorials"]
authors: ["Jane Smith"]

# Cover image configuration
cover:
  image: "hugo-website.jpg"
  alt: "Hugo logo with website mockups"
  caption: "Hugo makes building websites fast and fun"
  imageDisplay: true
  captionDisplay: true

# Display options
showFrontMatter: true
toc: true

# Page type (use "page" for documentation, "post" for blog posts)
type: "post"
---

Your content starts here...

Quick Reference

Minimal Post

YAML
1
2
3
4
---
title: "My Post"
date: 2024-11-27
---

Simple Page (No Metadata)

YAML
1
2
3
4
---
title: "About"
type: "page"
---

Blog Post with Cover

YAML
1
2
3
4
5
6
7
8
9
---
title: "My Article"
date: 2024-11-27
tags: ["blogging"]
cover:
  image: "cover.jpg"
  caption: "A beautiful cover image"
toc: true
---

Important Notes

  1. Page Bundles: Cover images must be placed in the same directory as your markdown file (page bundle structure)
  2. Type Behavior: Setting type: "page" completely bypasses metadata display, regardless of other settings
  3. Default Values: Most boolean parameters default to true or follow site-wide configuration
  4. Taxonomy Clouds: Displayed only on desktop views (hidden on screens < 1300px)
  5. Reading Time: Automatically calculated based on word count and site-configured reading speed