Skip to content

4. Content & Front Matter

Will Holmes edited this page May 21, 2022 · 17 revisions

Customizations you can make with content and front matter.

Creating Posts & Projects

It's recommended to create posts as page bundles by manually creating your bundle directory then running hugo new post/bundle-dir/index.md. This will create a new post according to the default posts.md archetype defined in themes/hugo-liftoff/archetypes/.

The same instructions apply for projects, simply replace post with project.

Archetypes for easier bundle creation will be added in a future release.

Post Front Matter

title

The title / H1 of your post. If seo_title isn't set, it will also be used as the <title> tag for SEO. It's also used on any list pages where posts are listed, and in Open Graph / Twitter Cards / Google structured data markup.

seo_title

Overrides the title as the <title> tag for SEO purposes.

summary

Overrides the description for any on-page post summaries. This includes list pages and in the banner section of single posts. It's also used in schema markups and RSS.

description

The <meta> description for SEO purposes. If not set, the global site description in config.toml will be used.

If summary isn't set, the description will also be used as a fallback for any on-page post summaries. It's also used heavily in schema markups and RSS.

slug

The URL slug of your post. If not set, Hugo will use the file or page bundle name instead.

author

Override the global author site param in params.toml for the author meta in <head>.

draft

Builds your post if true. To build drafts in development, use hugo server -D.

date

The default date your post was created.

lastmod

The last modified date of your post. This will add an extra date entry to your posts on list and single pages and add indicators to each date to signify which is which.

expiryDate

If the expiry date is in the past, Hugo won't build the post.

publishDate

Overrides date if set. If set in the future, the post won't be build by default unless you specify Hugo to build future posts.

feature_image

Specify a custom image to use for the featured image in the post. If not specified, Hugo resources will look for feature.* in your page bundle and use that.

feature_image_alt

The alt text for the feature image. Works even if the default image is used and feature_image isn't set.

categories

Taxonomy. Add categories to your post.

tags

Taxonomy. Add tags to your post.

series

Taxonomy. Add your post to a series of posts or create one. Single pages will contain a list of all other posts in the series, along with a next/prev in series navigation at the end of the post.

toc

Add a table of contents to the top of your post.

related

Include a list of related posts at the end of your post (will not be included if the post belongs to a series).

social_share

Add social share links to the end of your post.

newsletter

Include a newsletter just above the footer after your post. If global_newsletter is false in params.toml, enabling it in front matter will override the global setting and vice-versa.

disable_comments

Disable comments on a per-post basis if global comments are enabled with disqusShortname in params.toml.

Clone this wiki locally