Configure FixIt
Find out how to configure your Hugo FixIt site.
Configuration File
Hugo has some global configuration settings, which are beyond the scope of this article.
Before starting configuration, it is recommended that you execute the following command to copy the default hugo.toml of theme to your project:
|
|
For advanced use, you can also split your configuration by environment, root configuration key, and language instead of a single site configuration file.
More details can be found in the Configure Hugo page.
Menu Configuration
Hugo has a simple yet powerful menu system.
According to the interface provided by Hugo, FixIt theme only realizes some functions, it is enough to meet the needs of most people and make users easier to use.
The following is a complete menu item configuration:
In consideration of practicability and typesetting, the FixIt theme only supports two-tier nested menus, which can be configured through the parent
field in the menu configuration.
The parent item of a menu item should be the identifier
of another menu item, and the identifier should be unique in the menu.
In addition, you can also add content to the menu through the front matter
of the configuration page (i.e. the .md
-file).
Here is a yaml
example:
|
|
Theme Configuration
In addition to Hugo global configuration, FixIt provides some theme configuration via the root configuration keys params
.
A simple example:
|
|
All theme configuration settings are as follows:
Version
string
The FixIt theme version. e.g. 0.2.X
, 0.2.15
, v0.2.15
etc.
Description
string
The site description for SEO.
Keywords
string array
The site keywords for SEO.
DefaultTheme
string
The site default theme. Default is auto
. The configuration value for defaultTheme
can be one of:
- light
- light style for FixIt
- dark
- dark style for FixIt
- auto
- automatically switch between light and dark styles based on the user’s system preference
Fingerprint
string
Which hash function used for SRI, when empty, no SRI is used. The configuration value for fingerprint
can be one of sha256
, sha384
, sha512
, md5
.
DateFormat
string
The date format for the site. Default is 2006-01-02
.
Images
string array
Website images for Open Graph and Twitter Cards.
EnablePWA
bool
Enable PWA. Default is false
.
ExternalIcon
bool
Whether to add external Icon for external links automatically. Default is false
.
NavigationReverse
bool
Whether to reverse the order of the navigation menu. Default is false
.
WithSiteTitle
bool
Whether to add site title to the title of every page. Default is true
. Remember to set up your site title in hugo.toml
(e.g. title = "title"
)
TitleDelimiter
string
Title delimiter when the site title is be added to the title of every page. Default is -
.
IndexWithSubtitle
bool
Whether to add site subtitle to the title of index page. Default is false
. Remember to set up your site subtitle by params.header.subtitle.name
.
DisableThemeInject
bool
FixIt will, by default, inject a theme meta tag in the HTML head on the home page only. You can turn it off, but we would really appreciate if you don’t, as this is a good way to watch FixIt’s popularity on the rise. Default is false
.
Author
map
The author Configuration.
|
|
- name
string
The author’s name.string
The author’s email.- link
string
The author’s link.- avatar
string
The author’s avatar.
GitInfo
map
The Git repository information (only then enableGitInfo
is true
).
|
|
- repo
string
The public Git repository URL. e.g.https://github.com/hugo-fixit/docs
- branch
string
The public Git repository branch. Default ismain
.- dir
string
The content directory path relative to the root of the repository.- issueTpl
string
The issue template for reporting issue of the posts. Available template params:{title}
,{URL}
,{sourceURL}
.
App
map
The App icon Configuration.
|
|
- title
string
Optional site title override for the app when added to an iOS home screen or Android launcher.- noFavicon
bool
Whether to omit favicon resource links. Default isfalse
.- svgFavicon
string
Modern SVG favicon to use in place of older style.png
and.ico
files.- iconColor
string
Safari mask icon color. Default is#5bbad5
.- tileColor
string
Windows v8-10 tile color. Default is#da532c
.- themeColor
map
Android browser theme color.
- light:
string
The light theme color. Default is#f8f8f8
. - dark:
string
The dark theme color. Default is#252627
.
Search
map
The Search Configuration.
|
|
- enable
bool
Whether to enable search. Default isfalse
.- type
string
The type of search engine. The configuration value fortype
can be one ofalgolia
,fuse
. Default isfuse
.- contentLength
int
The max index length of the chunked content. Default is4000
.- placeholder
string
The placeholder of the search bar. Default is""
.- maxResultLength
int
The max number of results length. Default is10
.- snippetLength
int
The snippet length of the result. Default is30
.- highlightTag
string
The HTML tag name of the highlight part in results. Default isem
.- absoluteURL
bool
Whether to use the absolute URL based on the baseURL in search index. Default isfalse
.- algolia
map
The Algolia Configuration.
- index:
string
The Algolia index. - appID:
string
The Algolia appID. - searchKey:
string
The Algolia searchKey.
- fuse
map
The Fuse Configuration.
- isCaseSensitive:
bool
Whether the search is case sensitive. Default isfalse
. - minMatchCharLength:
int
The minimum number of characters that must be matched before a result is considered a match. Default is2
. - findAllMatches:
bool
Whether to find all matches. Default isfalse
. - location:
int
The location. Default is0
. - threshold:
float
The threshold. Default is0.3
. - distance:
int
The distance. Default is100
. - ignoreLocation:
bool
Whether to ignore location. Default isfalse
. - useExtendedSearch:
bool
Whether to use extended search. Default isfalse
. - ignoreFieldNorm:
bool
Whether to ignore field norm. Default isfalse
.
Based on algolia or Fuse.js, searching is supported in FixIt theme.
In order to generate index.json
for searching, add JSON
output file type to the home
of the outputs
part in your site configuration.
|
|
Header
map
The Header Configuration.
|
|
- desktopMode
string
Desktop header mode. The configuration value fordesktopMode
can be one ofsticky
,normal
,auto
. Default issticky
.- mobileMode
string
Mobile header mode. The configuration value formobileMode
can be one ofsticky
,normal
,auto
. Default isauto
.- title
map
The Header title Configuration.
- logo:
string
URL of the LOGO. - name:
string
Title name. - pre:
string
You can add extra information before the name (HTML format is supported), such as icons. - post:
string
You can add extra information after the name (HTML format is supported), such as icons. - typeit:
bool
Whether to use typeit animation for title name. Default isfalse
.
- name:
string
Subtitle name. - typeit:
bool
Whether to use typeit animation for subtitle name. Default isfalse
.
Breadcrumb
map
The Breadcrumb Configuration.
|
|
- enable
bool
Whether to enable breadcrumb. Default isfalse
.- sticky
bool
Whether to make the breadcrumb sticky. Default isfalse
.- showHome
bool
Whether to show the home link in the breadcrumb. Default isfalse
.
Footer
map
The Footer Configuration.
|
|
- enable
bool
Whether to enable footer. Default istrue
.- copyright
bool
Whether to show copyright info. Default istrue
.- author
bool
Whether to show the author. Default istrue
.- since
int
Site creation year.- gov
string
Public network security only in China (HTML format is supported).- icp
string
ICP info only in China (HTML format is supported).- license
string
License info (HTML format is supported).- powered
map
The Footer powered Configuration.
- enable:
bool
Whether to show Hugo and theme info. Default istrue
. - hugoLogo:
bool
Whether to show Hugo logo. Default istrue
. - themeLogo:
bool
Whether to show theme logo. Default istrue
.
- enable:
bool
Whether to show site creation time. Default isfalse
. - animate:
bool
Whether to animate the site creation time. Default istrue
. - icon:
string
The icon of the site creation time. Default isfa-solid fa-heartbeat
. - pre:
string
You can add extra information before the value (HTML format is supported). - value:
string
The value of the site creation time. e.g.2021-12-18T16:15:22+08:00
.
- powered:
int
The order of the powered line. Default is0
. - copyright:
int
The order of the copyright line. Default is0
. - statistics:
int
The order of the statistics line. Default is0
. - visitor:
int
The order of the visitor line. Default is0
. - beian:
int
The order of the beian line. Default is0
.
The order value can be one of first
, 0
, 1
, 2
, 3
, 4
, 5
, last
.
Archives
map
The Archives page Configuration.
|
|
- paginate
int
Special amount of posts in each archives page. Default is20
.- dateFormat
string
Date format (month and day). Default is01-02
.
Section
map
The Section page Configuration.
|
|
- paginate
int
Special amount of posts in each section page. Default is20
.- dateFormat
string
Date format (month and day). Default is01-02
.- rss
int
Amount of RSS pages. Default is10
.- recentlyUpdated
map
The Recently Updated posts Configuration.
- enable:
bool
Whether to enable recently updated posts. Default isfalse
. - rss:
bool
Whether to enable recently updated posts in RSS. Default isfalse
. - days:
int
The days of recently updated posts. Default is30
. - maxCount:
int
The max count of recently updated posts. Default is10
.
List
map
The List (category or tag) page Configuration.
|
|
- paginate
int
Special amount of posts in each list page. Default is20
.- dateFormat
string
Date format (month and day). Default is01-02
.- rss
int
Amount of RSS pages. Default is10
.
Tagcloud
map
The TagCloud Configuration for tags page.
|
|
- enable
bool
Whether to enable tagcloud. Default isfalse
.- min
int
Minimum font size in px. Default is14
.- max
int
Maximum font size in px. Default is32
.- peakCount
int
Maximum count of posts per tag. Default is10
.- orderby
string
Order of tags. The configuration value fororderby
can be one ofname
,count
. Default isname
.
Home
map
The Home page Configuration.
|
|
- rss
int
Amount of RSS pages. Default is10
.- profile
map
The Home page profile Configuration.
- enable:
bool
Whether to enable home page profile. Default isfalse
. - gravatarEmail:
string
Gravatar Email for preferred avatar in home page. - avatarURL:
string
URL of avatar shown in home page. - avatarMenu:
string
Identifier of avatar menu link. - title:
string
Title shown in home page (HTML format is supported). - subtitle:
string
Subtitle shown in home page. - typeit:
bool
Whether to use typeit animation for subtitle. Default istrue
. - social:
bool
Whether to show social links. Default istrue
. - disclaimer:
string
Disclaimer (HTML format is supported).
- posts
map
The Home page posts Configuration.
- enable:
bool
Whether to enable home page posts. Default istrue
. - paginate:
int
Special amount of posts in each home posts page. Default is6
.
Social
map
Social Configuration about the author.
The default data of all supported social links is located in themes/FixIt/assets/data/social.yaml
,
which is you can refer to.
You can directly set your ID to get a default social link and its icon:
|
|
The social link generated is https://mastodon.technology/@xxxx
.
Or You can set more options through a object:
|
|
Typeit
map
TypeIt Configuration.
|
|
- speed
int
Typing speed between each step (measured in milliseconds). Default is100
.- cursorSpeed
int
Blinking speed of the cursor (measured in milliseconds). Default is1000
.- cursorChar
string
Character used for the cursor (HTML format is supported). Default is|
.- duration
int
Cursor duration after typing finishing (measured in milliseconds,-1
means unlimited). Default is-1
.- loop
bool
Whether your strings will continuously loop after completing. Default isfalse
.
Mermaid
map
Mermaid Configuration.
|
|
- themes
string array(2)
Themes for Mermaid. See Mermaid Themes for available values.
Pangu
map
PanguJS Configuration.
|
|
- enable
bool
Whether to enable PanguJS. Default isfalse
.- selector
string
The selector of PanguJS. Default isarticle
.
Watermark
map
Watermark Configuration. See Watermark for more information.
|
|
Ibruce
map
Busuanzi count Configuration.
|
|
- enable
bool
Whether to enable Busuanzi count. Default isfalse
.- enablePost
bool
Whether to enable Busuanzi count in post meta. Default isfalse
.
Verification
map
Site verification code Configuration for Google/Bing/Yandex/Pinterest/Baidu/360/Sogou.
|
|
Seo
map
Site SEO Configuration.
|
|
- image
string
Image URL.- thumbnailUrl
string
Thumbnail URL.
Analytics
map
Analytics Configuration.
|
|
- enable
bool
Whether to enable analytics. Default isfalse
.map
Google Analytics Configuration.
- id:
string
Google Analytics ID. - anonymizeIP:
bool
Whether to anonymize IP. Default istrue
.
- fathom
map
Fathom Analytics Configuration.
- id:
string
Fathom Analytics ID. - server:
string
Server URL for your tracker if you’re self hosting.
Cookieconsent
map
Cookie consent Configuration.
|
|
- enable
bool
Whether to enable cookie consent. Default istrue
.- content
map
Cookie consent content Configuration.
- message:
string
The message of cookie consent. - dismiss:
string
The dismiss of cookie consent. - link:
string
The link of cookie consent.
Cdn
map
CDN Configuration for third-party library files.
|
|
- data
string
CDN data file name, disabled by default. The data file is located inthemes/FixIt/assets/data/cdn/
directory. You can store your own data files in the same path under your project:assets/data/cdn/
. The configuration value fordata
can be one ofjsdelivr.yml
,unpkg.yml
, etc.
Compatibility
map
Compatibility Configuration.
|
|
- polyfill
bool
Whether to use Polyfill.io to be compatible with older browsers. Default isfalse
.- objectFit
bool
Whether to use object-fit-images to be compatible with older browsers. Default isfalse
.
GithubCorner
map
GitHub banner in the top-right or top-left corner.
|
|
- enable
bool
Whether to enable GitHub banner. Default isfalse
.- permalink
string
The URL of the GitHub repository. e.g.https://github.com/hugo-fixit/FixIt
- title
string
The title of the GitHub banner.- position
string
The position of the GitHub banner. The configuration value forposition
can be one ofleft
,right
. Default isright
.
Gravatar
map
Gravatar Configuration.
|
|
- enable
bool
Whether to enable Gravatar. Default isfalse
.
Depends on the author’s email, if the author’s email is not set, the local avatar will be used.- host
string
Gravatar host. e.g.www.gravatar.com
,cravatar.cn
etc. Default iswww.gravatar.com
.- style
string
Gravatar style. The configuration value forstyle
can be one ofmp
,identicon
,monsterid
,wavatar
,retro
,blank
,robohash
. Default is""
.
BackToTop
map
Back to top Configuration.
|
|
- enable
bool
Whether to enable back to top. Default istrue
.- scrollpercent
bool
Scroll percent label in b2t button. Default isfalse
.
ReadingProgress
map
Reading progress bar Configuration.
|
|
- enable
bool
Whether to enable reading progress bar. Default isfalse
.- start
string
The start position of reading progress bar. The configuration value forstart
can be one ofleft
,right
. Default isleft
.- position
string
The position of reading progress bar. The configuration value forposition
can be one oftop
,bottom
. Default istop
.- reversed
bool
Whether to reverse the reading progress bar. Default isfalse
.- light
string
The light color of reading progress bar. Default is""
.- dark
string
The dark color of reading progress bar. Default is""
.- height
string
The height of reading progress bar. Default is2px
.
Pace
map
Progress bar in the top during page loading, based on Pace.js.
|
|
- enable
bool
Whether to enable pace. Default isfalse
.- color
string
The color of pace. All available colors:black
,blue
,green
,orange
,pink
,purple
,red
,silver
,white
,yellow
. Default isblue
.- theme
string
The theme of pace. All available themes:barber-shop
,big-counter
,bounce
,center-atom
,center-circle
,center-radar
,center-simple
,corner-indicator
,fill-left
,flash
,flat-top
,loading-bar
,mac-osx
,material
,minimal
. Default isminimal
.
Dev
map
Developer options.
Select the scope named public_repo
to generate personal access token, Configure with environment variable HUGO_PARAMS_GHTOKEN=xxx
, see https://gohugo.io/functions/os/getenv/#examples.
|
|
- enable
bool
Whether to enable developer options. Default isfalse
.- c4u
bool
Whether to check for updates. Default isfalse
.- mDevtools
map
Mobile Devtools Configuration.
- enable:
bool
Whether to enable mobile devtools. Default isfalse
. - type:
string
The type of mobile devtools. The configuration value fortype
can be one ofvConsole
,eruda
. Default isvConsole
.
Page
map
The configuration of each page.
|
|
Markup Configuration
Configure rendering of markup to HTML via the root configuration keys markup
.
This section only records some necessary configuration for the FixIt theme. For more details, see the Configure markup page.
|
|
Custom Output Formats
Hugo can output content in multiple formats. The FixIt theme takes advantage of this feature. In order to fully configure the theme, configure the following options into hugo.toml
.
More details about the configuration of output formats can be found in the Custom output formats page.
Favicon Generation
It is recommended to put your own favicons, browserconfig.xml
and site.webmanifest
files into the /static
directory.
- android-chrome-192x192.png
- android-chrome-512x512.png
- apple-touch-icon.png
- browserconfig.xml
- favicon-32x32.png
- favicon-16x16.png
- favicon.ico
- mstile-150x150.png
- safari-pinned-tab.svg
They’re easily created via https://realfavicongenerator.net/.