-
Notifications
You must be signed in to change notification settings - Fork 30
4. Content & Front Matter
Customizations you can make with content and front matter.
It's recommended to create posts as page bundles by manually creating your bundle directory with mkdir content/posts/bundle-dir
then running hugo new posts/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 posts
with projects
.
Archetypes for easier bundle creation will be added in a future release.
The following front matter parameters can be viewed within themes/hugo-liftoff/archetypes/posts.md
. When you create a new post with hugo new
, they will auto-populate for you.
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. Defaults to the file name via archetypes.
Give your post a custom SEO <title>
tag that differs from the post title. Overrides title
.
Overrides the description
for any on-page post summaries. This includes list pages and the banner section of single posts. It's also used in schema markups and RSS.
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.
The URL slug of your post. If not set, Hugo will use the file or page bundle name instead.
Override the global author
site param in params.toml
for the author meta in <head>
.
Builds your post if true
. To build drafts in development, use hugo server -D
.
The default date your post was created. Generated automatically by post archetypes.
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. It's also used heavily by SEO schemas as a last_modified
field.
If the expiry date is set to a date in the past, Hugo won't build the post.
Overrides the date
if set. If set in the future, the post won't be built by default unless you specify Hugo to build future posts with --buildFuture
.
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.
The alt text for the feature image. Works even if the default image is used and feature_image
isn't set.
Adds posts to the category taxonomy and lists them on the page for that term.
Adds posts to the tag taxonomy and lists them on the page for that term.
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. This will disable the standard next/prev posts links and related posts at the bottom of posts.
Add a table of contents to the top of your post.
Include a list of related posts at the end of your post if they exist (will not be included if the post belongs to a series).
Add social share icons to the end of your post.
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 on a per-post basis if global comments are enabled with disqusShortname
in params.toml
.
The following front matter parameters can be viewed within themes/hugo-liftoff/archetypes/projects.md
. When you create a new project with hugo new
, they will auto-populate for you.
The following parameters are shared with posts.
title
seo_title
summary
description
slug
author
draft
date
lastmod
expiryDate
publishDate
feature_image
feature_image_alt
Taxonomy. Tag your projects by the type of project (e.g. Client, Personal, Open Source, etc.). This will add an indicator in the top right corner of project cards and on the project single page. If you list more than one, only the first will be used for the indicator.
List the tech stack your project is built with, or any other set of data you want. This isn't a taxonomy so it won't create term pages for each one. However, you could easily add it as one to achieve this functionality.
The live URL of your project hosted somewhere. Will be added to project cards and in the banner of project single pages.
A link to the source code of your project. Will be added to project cards and in the banner of project single pages.
In addition to posts and projects, you can customize many aspects of the theme from a section page's _index.md
file, or a single page's index.md
file. title
, seo_title
, summary
and description
are the most applicable choices.
You can customize the home page by creating or editing an _index.md
file at the top-level of your content
directory.
This will customize the main hero title of the home page.
This will customize the main hero description / subtitle of the home page.
Update the <title>
tag with a custom SEO title instead of using the site title from config.toml
.
You can customize the text of the posts and projects sections on the home page with posts_section_title
, posts_section_description
, projects_section_title
and projects_section_description
.
Create an about page by adding an about
directory within content
with a content/about/index.md
file. Add type: about
to the front matter and include title
, seo_title
and description
fields if desired.
You can add additional body text within your markdown.
Create a contact page by adding a contact
directory within content
with a content/contact/index.md
file. Add type: contact
to the front matter and include title
, seo_title
and description
fields if desired.
You can add additional body text within your markdown.
Hugo Liftoff supports nested subsections within your posts
content. Create a directory within content/posts/
with a content/posts/_index.md
file. Add title
, seo_title
, summary
and description
fields if desired.
Creating posts in a subsection works the same as creating regular posts. Simply add the subsection to the hugo new
path.