Content Management Overview
Find out how to create and organize your content quickly and intuitively in FixIt theme.
Contents Organization
A few suggestions to help you get a good looking site quickly:
- Keep post pages in the
content/posts
directory, for example:content/posts/my-first-post.md
- Keep other pages in the
content
directory, for example:content/about.md
- Local resources organization
There are three ways to reference local resources such as images and music:
- Using page resources in page bundles.
You can reference page resources by the value for
Resources.GetMatch
or the filepath of the resource relative to the page directory directly. - Store resources in the assets directory, which is
/assets
by default. The filepath of the resource to reference in the post is relative to the assets directory. - Store resources in the static directory, which is
/static
by default. The filepath of the resource to reference in the post is relative to the static directory.
The priority of references is also in the above order.
There are many places in the theme where the above local resource references can be used,
such as links, images, image
shortcode, music
shortcode and some params in the front matter.
Images in page resources or assets directory processing will be supported in the future. It’s really cool!
Front Matter
Hugo allows you to add front matter in yaml
, toml
or json
to your content files.
page
part in your theme configuration are inconsistent.title: the title for the content.
date: the datetime assigned to this page, which is usually fetched from the
date
field in front matter, but this behaviour is configurabl in the theme configuration.lastmod: the datetime at which the content was last modified.
draft: if
true
, the content will not be rendered unless the--buildDrafts
/-D
flag is passed to thehugo
command.author: the author config for the content, the same as the
params.author
part in the theme configuration.1 2 3 4 5
author: name: "" # the author's name link: "" # the link of the author email: "" # the email of the author, used to set a Gravatar avatar, which takes precedence over `author.avatar` avatar: "" # the local avatar of the author
authorEmail:
the email of the author, migrate toauthor.email
gravatarForce:
Gravatar is force-used as the author’s avatar.authorAvatar: whether to enable the author’s avatar of the post.
description: the description for the content.
keywords: the keywords for the content.
license: the special lisence for this content.
images: page images for Open Graph and Twitter Cards.
tags: the tags for the content.
categories: the categories for the content.
featuredImage: the featured image for the content.
featuredImagePreview: the featured image for the content preview in the home page.
hiddenFromHomePage: if
true
, the content will not be shown in the home page.hiddenFromSearch: if
true
, the content will not be shown in the search results.lightgallery: the same as the
params.page.lightgallery
part in the theme configuration.ruby: if
true
, the content will enable the ruby extended syntax.fraction: if
true
, the content will enable the fraction extended syntax.fontawesome: if
true
, the content will enable the Font Awesome extended syntax.linkToMarkdown: if
true
, the footer of the content will be shown the link to the orignal Markdown file.rssFullText: if
true
, the full text content will be shown in RSS.pageStyle: Detail see Page Style.
toc: the same as the
params.page.toc
part in the theme configuration.expirationReminder: the same as the
params.page.expirationReminder
part in the theme configuration.code: the same as the
params.page.code
part in the theme configuration.edit: the same as the
params.page.edit
part in the theme configuration.math: the same as the
params.page.math
part in the theme configuration.mapbox: the same as the
params.page.mapbox
part in the theme configuration.share: the same as the
params.page.share
part in the theme configuration.comment: the same as the
params.page.comment
part in the theme configuration.library: the same as the
params.page.library
part in the theme configuration.seo: the same as the
params.page.seo
part in the theme configuration.type: the rendering template of page, see templates for details.
menu: see Add content to Menu.
password: password of encrypted page content, see Content Encryption.
message: encryption prompt, see Content Encryption.
repost: the same as the
params.page.repost
part in the theme configuration.autoBookmark: the same as the
params.page.autoBookmark
part in the theme configuration.wordCount: the same as the
params.page.wordCount
part in the theme configuration.readingTime: the same as the
params.page.readingTime
part in the theme configuration.endFlag: the same as the
params.page.endFlag
part in the theme configuration.reward: the same as the
params.page.reward
part in the theme configuration.instantPage: the same as the
params.page.instantPage
part in the theme configuration.
featuredImage and featuredImagePreview support the complete usage of local resource references.
If the page resource with name: featured-image
or name: featured-image-preview
is set in the front matter,
it is not necessary to set the parameter featuredImage
or featuredImagePreview
:
|
|
Some archetypes are embedded in the FixIt theme, which will take effect when creating new content with the following commands, and the front matter will be automatically brought in.
|
|
Here is a front matter example:
|
|
Content Summaries
FixIt theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content.
Automatic Summary Splitting
By default, Hugo automatically takes the first 70 words of your content as its summary.
You may customize the summary length by setting summaryLength
in the site configuration.
If you are creating content in a CJK language and want to use Hugo’s automatic summary splitting, set hasCJKLanguage
to true
in your site configuration.
Manual Summary Splitting
Alternatively, you may add the <!--more-->
summary divider where you want to split the article.
Content that comes before the summary divider will be used as that content’s summary.
<!--more-->
exactly; i.e., all lowercase and with no whitespace.Front Matter Summary
You might want your summary to be something other than the text that starts the article. In this case you can provide a separate summary in the summary
variable of the article front matter.
Use Description as Summary
You might want your description in the description
variable of the article front matter as the summary.
You may add the <!--more-->
summary divider at the start of the article. Keep content that comes before the summary divider empty. Then FixIt theme will use your description as the summary.
Priority Order of Summary Selection
Because there are multiple ways in which a summary can be specified it is useful to understand the order. It is as follows:
- If there is a
<!--more-->
summary divider present in the article but no content is before the divider, the description will be used as the summary. - If there is a
<!--more-->
summary divider present in the article the text up to the divider will be provided as per the manual summary split method. - If there is a summary variable in the article front matter the value of the variable will be provided as per the front matter summary method.
- The text at the start of the article will be provided as per the automatic summary split method.
Templates
Generally, you don’t need to set the type parameter, because Hugo and fixit will help you choose. However, the FixIt theme provides some special templates for users to use.
Friends
Set type: friends
in the front matter and create data file named friends.yml
in the yourSite/data/
directory, whose content format is as follows:
|
|
You can use the following command to quickly create a friends page:
|
|
Offline
See PWA Support for details.
Set type: offline
in the front matter and set enablePWA
in config.toml
:
|
|
You can use the following command to quickly create a offline page:
|
|
Content Encryption
This part is shown in the content encryption page.
Markdown Syntax
This part is shown in the basic markdown syntax page and the extended markdown syntax page.
Shortcodes
This part is shown in the shortcodes page.