Content Management Overview

Contents

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
  • Use _index.md to translate list page titles, for example: content/posts/_index.md
  • Local resources organization

There are three ways to reference local resources such as images and music:

  1. 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.
  2. 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.
  3. 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.

Tip

It is recommended to use CoverView to generate beautiful cover images for your articles.

  • Online Tool: No software installation required, works in your browser
  • 🎨 Multiple Templates: Various preset templates and customization options
  • 📐 Theme Compatible: Perfectly adapted to FixIt theme design style
  • 🚀 Quick Generation: One-click download and quick cover generation

Project: Lruihao/CoverView

Templates

Generally, you don’t need to set the type or layout parameter, because Hugo and FixIt will help you choose. However, in some special cases, you need to specify the template explicitly.

Posts in Other Directories

Sometimes you may need to put some posts in a separate directory, rather than the content/posts directory. In this case, you need to set the type: posts parameter in the front matter of the post.

For example, put all the documentation posts in the content/documentation directory, and all the posts in this directory use the posts template:

1
2
3
4
---
title: Content Management Overview
date: 2024-04-06T12:57:26+08:00
---

Tip

You can set the cascade.params.type parameter to posts in content/documentation/_index.md, so that all posts in the content/documentation directory will use the posts template.

1
2
3
4
5
6
---
title: Documentation
cascade:
  params:
    type: posts
---

Friends

FixIt 0.2.12 | NEW

Set layout: friends in the front matter and create data file named friends.yml in the yourSite/data/ directory, whose content format is as follows:

1
2
3
4
5
# Friend/Site info of one
- nickname: friend's name
  avatar: friend's avatar
  url: site link
  description: description of friend/site
Tip

You can use the following command to quickly create a friends page:

1
hugo new friends/index.md
FixIt 0.3.16 | NEW

See CSE Support.

Projects

This is an additional theme component, please refer to hugo-fixit/component-projects.

Front matter

This part is shown in the Front matter page.

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.

Summary Preview
Summary Preview

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 CJKChinese/Japanese/Korean 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.

Note

Be careful to enter <!--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.

Comparison

Each summary type has different characteristics:

TypePrecedenceRenders markdownRenders shortcodesWraps single lines with <p>
Manual1✔️✔️✔️
Front matter2✔️
Automatic3✔️✔️
  1. 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.
  2. 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.
  3. 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.
  4. The text at the start of the article will be provided as per the automatic summary split method.

Tip

If you want plain text summaries, you can set params.summary_plainify or Front matter summary_plainify.

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.

Content Encryption

This part is shown in the content encryption page.

URL management

Hugo has a powerful URL management system, see Hugo URL management.

Multilingual and I18n

FixIt theme is fully compatible with Hugo multilingual mode, which provides in-browser language switching.

Language Switch
Language Switch

Compatibility

LanguageHugo CodeHTML lang AttributeTheme Docs
Englishenen
Simplified Chinesezh-cnzh-CN
Traditional Chinesezh-twzh-TW
Frenchfrfr
Polishplpl
Brazilian Portuguesept-brpt-BR
Italianitit
Spanisheses
Germandede
Serbiansrsr
Russianruru
Romanianroro
Vietnamesevivi
Hindihihi
Japanesejaja
Koreankoko
Arabicarar
Persianfafa
Urduurur

Basic Configuration

After learning how Hugo handle multilingual websites, define your languages in your site configuration.

For example with English, Chinese and French website:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
# [en, zh-cn, fr, pl, ...] determines default content language
defaultContentLanguage = "en"

[languages]

[languages.en]
weight = 1
title = "My Hugo FixIt Site"
locale = "en"
label = "English"

[[languages.en.menu.main]]
identifier = "posts"
pre = ""
post = ""
name = "Posts"
url = "/posts/"
title = ""
weight = 1

[[languages.en.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "Tags"
url = "/tags/"
title = ""
weight = 2

[[languages.en.menu.main]]
identifier = "categories"
pre = ""
post = ""
name = "Categories"
url = "/categories/"
title = ""
weight = 3

[languages.zh-cn]
weight = 2
title = "我的 Hugo FixIt 网站"
# language code, CN only here
locale = "zh-CN"
label = "简体中文"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = true

[[languages.zh-cn.menu.main]]
identifier = "posts"
pre = ""
post = ""
name = "文章"
url = "/posts/"
title = ""
weight = 1

[[languages.zh-cn.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "标签"
url = "/tags/"
title = ""
weight = 2

[[languages.zh-cn.menu.main]]
identifier = "categories"
pre = ""
post = ""
name = "分类"
url = "/categories/"
title = ""
weight = 3

[languages.fr]
weight = 3
title = "Mon nouveau site Hugo FixIt"
locale = "fr"
label = "Français"

[[languages.fr.menu.main]]
identifier = "posts"
pre = ""
post = ""
name = "Postes"
url = "/posts/"
title = ""
weight = 1

[[languages.fr.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "Balises"
url = "/tags/"
title = ""
weight = 2

[[languages.fr.menu.main]]
identifier = "categories"
name = "Catégories"
pre = ""
post = ""
url = "/categories/"
title = ""
weight = 3

Then, for each new page, append the language code to the file name.

Single file my-page.md is split in three files:

  • in English: my-page.en.md
  • in Chinese: my-page.zh-cn.md
  • in French: my-page.fr.md

Note

Use Front Matter parameter to translate urls too.

RTL Language Support

For RTL (Right-to-Left) languages such as Arabic and Persian, you need to set the direction parameter to "rtl" in the language configuration. The theme will automatically apply the correct text direction via the HTML dir attribute.

1
2
3
4
5
6
[languages.ar]
weight = 4
title = "موقعي Hugo FixIt"
locale = "ar"
label = "العربية"
direction = "rtl"

Note

LTR languages do not need to set the direction parameter, as "ltr" is the default value.

For a live demo, see the English version and Arabic version of the RTL test for comparison.

Overwrite Translation Strings

Translations strings are used for common default values used in the theme. Translations are available in some languages, but you may use another language or want to override default values.

To override these values, create a new file in your local I18n folder i18n/<languageCode>.toml and inspire yourself from themes/FixIt/i18n/en.toml.

By the way, as these translations could be used by other people, please take the time to propose a translation by making a PR to the theme!

Automatic Translation

With the Auto Translate component, you can automatically translate a single-language site into multiple languages with minimal configuration.

Auto Translate
Auto Translate to Multiple Languages

Tip

This is an additional theme component, please refer to hugo-fixit/cmpt-translate.


Related Content

Buy me a coffee
Lruihao AlipayAlipay
Lruihao WeChat PayWeChat Pay

Update Available

A new version of this site is available.