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
stringThe author’s name.stringThe author’s email.- link
stringThe author’s link.- avatar
stringThe author’s avatar.
gitInfo
map The Git repository information (only then enableGitInfo is true).
| |
- repo
stringThe public Git repository URL. e.g.https://github.com/hugo-fixit/docs- branch
stringThe public Git repository branch. Default ismain.- dir
stringThe content directory path relative to the root of the repository.- issueTpl
stringThe issue template for reporting issue of the posts. Available template params:{title},{URL},{sourceURL}.
app
map The App icon Configuration.
| |
- title
stringOptional site title override for the app when added to an iOS home screen or Android launcher.- noFavicon
boolWhether to omit favicon resource links. Default isfalse.- svgFavicon
stringModern SVG favicon to use in place of older style.pngand.icofiles.- iconColor
stringSafari mask icon color. Default is#5bbad5.- tileColor
stringWindows v8-10 tile color. Default is#da532c.- themeColor
mapAndroid browser theme color.
- light:
stringThe light theme color. Default is#f8f8f8. - dark:
stringThe dark theme color. Default is#252627.
search
map The Search Configuration.
| |
- enable
boolWhether to enable search. Default isfalse.- type
stringThe type of search engine. The configuration value fortypecan be one ofalgolia,fuse. Default isfuse.- contentLength
intThe max index length of the chunked content. Default is4000.- placeholder
stringThe placeholder of the search bar. Default is"".- maxResultLength
intThe max number of results length. Default is10.- snippetLength
intThe snippet length of the result. Default is30.- highlightTag
stringThe HTML tag name of the highlight part in results. Default isem.- absoluteURL
boolWhether to use the absolute URL based on the baseURL in search index. Default isfalse.- algolia
mapThe Algolia Configuration.
- index:
stringThe Algolia index. - appID:
stringThe Algolia appID. - searchKey:
stringThe Algolia searchKey.
- fuse
mapThe Fuse Configuration.
- isCaseSensitive:
boolWhether the search is case sensitive. Default isfalse. - minMatchCharLength:
intThe minimum number of characters that must be matched before a result is considered a match. Default is2. - findAllMatches:
boolWhether to find all matches. Default isfalse. - location:
intThe location. Default is0. - threshold:
floatThe threshold. Default is0.3. - distance:
intThe distance. Default is100. - ignoreLocation:
boolWhether to ignore location. Default isfalse. - useExtendedSearch:
boolWhether to use extended search. Default isfalse. - ignoreFieldNorm:
boolWhether 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
stringDesktop header mode. The configuration value fordesktopModecan be one ofsticky,normal,auto. Default issticky.- mobileMode
stringMobile header mode. The configuration value formobileModecan be one ofsticky,normal,auto. Default isauto.- title
mapThe Header title Configuration.
- logo:
stringURL of the LOGO. - name:
stringTitle name. - pre:
stringYou can add extra information before the name (HTML format is supported), such as icons. - post:
stringYou can add extra information after the name (HTML format is supported), such as icons. - typeit:
boolWhether to use typeit animation for title name. Default isfalse.
- name:
stringSubtitle name. - typeit:
boolWhether to use typeit animation for subtitle name. Default isfalse.
breadcrumb
map The Breadcrumb Configuration.
| |
- enable
boolWhether to enable breadcrumb. Default isfalse.- sticky
boolWhether to make the breadcrumb sticky. Default isfalse.- showHome
boolWhether to show the home link in the breadcrumb. Default isfalse.
footer
map The Footer Configuration.
| |
- enable
boolWhether to enable footer. Default istrue.- custom
stringCustom content (HTML format is supported). For advanced use, see parameterparams.customFilePath.footer.- copyright
boolWhether to show copyright info. Default istrue.- author
boolWhether to show the author. Default istrue.- since
intSite creation year.- gov
stringPublic network security only in China (HTML format is supported).- icp
stringICP info only in China (HTML format is supported).- license
stringLicense info (HTML format is supported).- powered
mapThe Footer powered Configuration.
- enable:
boolWhether to show Hugo and theme info. Default istrue. - hugoLogo:
boolWhether to show Hugo logo. Default istrue. - themeLogo:
boolWhether to show theme logo. Default istrue.
- enable:
boolWhether to show site creation time. Default isfalse. - animate:
boolWhether to animate the site creation time. Default istrue. - icon:
stringThe icon of the site creation time. Default isfa-solid fa-heartbeat. - pre:
stringYou can add extra information before the value (HTML format is supported). - value:
stringThe value of the site creation time. e.g.2021-12-18T16:15:22+08:00.
- powered:
intThe order of the powered line. Default is0. - copyright:
intThe order of the copyright line. Default is0. - statistics:
intThe order of the statistics line. Default is0. - visitor:
intThe order of the visitor line. Default is0. - beian:
intThe 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
intSpecial amount of posts in each archives page. Default is20.- dateFormat
stringDate format (month and day). Default is01-02.
section
map The Section page Configuration.
| |
- paginate
intSpecial amount of posts in each section page. Default is20.- dateFormat
stringDate format (month and day). Default is01-02.- rss
intAmount of RSS pages. Default is10.- recentlyUpdated
mapThe Recently Updated posts Configuration.
- enable:
boolWhether to enable recently updated posts. Default isfalse. - rss:
boolWhether to enable recently updated posts in RSS. Default isfalse. - days:
intThe days of recently updated posts. Default is30. - maxCount:
intThe max count of recently updated posts. Default is10.
list
map The List (category or tag) page Configuration.
| |
- paginate
intSpecial amount of posts in each list page. Default is20.- dateFormat
stringDate format (month and day). Default is01-02.- rss
intAmount of RSS pages. Default is10.
tagcloud
map The TagCloud Configuration for tags page.
| |
- enable
boolWhether to enable tagcloud. Default isfalse.- min
intMinimum font size in px. Default is14.- max
intMaximum font size in px. Default is32.- peakCount
intMaximum count of posts per tag. Default is10.- orderby
stringOrder of tags. The configuration value fororderbycan be one ofname,count. Default isname.
home
map The Home page Configuration.
| |
- rss
intAmount of RSS pages. Default is10.- profile
mapThe Home page profile Configuration.
- enable:
boolWhether to enable home page profile. Default isfalse. - gravatarEmail:
stringGravatar Email for preferred avatar in home page. - avatarURL:
stringURL of avatar shown in home page. - avatarMenu:
stringIdentifier of avatar menu link. - title:
stringTitle shown in home page (HTML format is supported). - subtitle:
stringSubtitle shown in home page. - typeit:
boolWhether to use typeit animation for subtitle. Default istrue. - social:
boolWhether to show social links. Default istrue. - disclaimer:
stringDisclaimer (HTML format is supported).
- posts
mapThe Home page posts Configuration.
- enable:
boolWhether to enable home page posts. Default istrue. - paginate:
intSpecial 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
intTyping speed between each step (measured in milliseconds). Default is100.- cursorSpeed
intBlinking speed of the cursor (measured in milliseconds). Default is1000.- cursorChar
stringCharacter used for the cursor (HTML format is supported). Default is|.- duration
intCursor duration after typing finishing (measured in milliseconds,-1means unlimited). Default is-1.- loop
boolWhether 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
boolWhether to enable PanguJS. Default isfalse.- selector
stringThe selector of PanguJS. Default isarticle.
watermark
map Watermark Configuration. See Watermark for more information.
| |
ibruce
map Busuanzi count Configuration.
| |
- enable
boolWhether to enable Busuanzi count. Default isfalse.- enablePost
boolWhether 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
stringImage URL.- thumbnailUrl
stringThumbnail URL.
analytics
map Analytics Configuration.
| |
- enable
boolWhether to enable analytics. Default isfalse.mapGoogle Analytics Configuration.
- id:
stringGoogle Analytics ID. - anonymizeIP:
boolWhether to anonymize IP. Default istrue.
- fathom
mapFathom Analytics Configuration.
- id:
stringFathom Analytics ID. - server:
stringServer URL for your tracker if you’re self hosting.
cookieconsent
map Cookie consent Configuration.
| |
- enable
boolWhether to enable cookie consent. Default istrue.- content
mapCookie consent content Configuration.
- message:
stringThe message of cookie consent. - dismiss:
stringThe dismiss of cookie consent. - link:
stringThe link of cookie consent.
cdn
map CDN Configuration for third-party library files.
| |
- data
stringCDN 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 fordatacan be one ofjsdelivr.yml,unpkg.yml, etc.
compatibility
map Compatibility Configuration.
| |
- polyfill
boolWhether to use Polyfill.io to be compatible with older browsers. Default isfalse.- objectFit
boolWhether 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
boolWhether to enable GitHub banner. Default isfalse.- permalink
stringThe URL of the GitHub repository. e.g.https://github.com/hugo-fixit/FixIt- title
stringThe title of the GitHub banner.- position
stringThe position of the GitHub banner. The configuration value forpositioncan be one ofleft,right. Default isright.
gravatar
map Gravatar Configuration.
| |
- enable
boolWhether 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
stringGravatar host. e.g.www.gravatar.com,cn.gravatar.cometc. Default iswww.gravatar.com.- style
stringGravatar style. The configuration value forstylecan be one ofmp,identicon,monsterid,wavatar,retro,blank,robohash. Default is"".
backToTop
map Back to top Configuration.
| |
- enable
boolWhether to enable back to top. Default istrue.- scrollpercent
boolScroll percent label in b2t button. Default isfalse.
readingProgress
map Reading progress bar Configuration.
| |
- enable
boolWhether to enable reading progress bar. Default isfalse.- start
stringThe start position of reading progress bar. The configuration value forstartcan be one ofleft,right. Default isleft.- position
stringThe position of reading progress bar. The configuration value forpositioncan be one oftop,bottom. Default istop.- reversed
boolWhether to reverse the reading progress bar. Default isfalse.- light
stringThe light color of reading progress bar. Default is"".- dark
stringThe dark color of reading progress bar. Default is"".- height
stringThe height of reading progress bar. Default is2px.
pace
map Progress bar in the top during page loading, based on Pace.js.
| |
- enable
boolWhether to enable pace. Default isfalse.- color
stringThe color of pace. All available colors:black,blue,green,orange,pink,purple,red,silver,white,yellow. Default isblue.- theme
stringThe 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.
customFilePath
map Define custom file paths and create your custom files in site directory layouts/partials/custom.
| |
dev
map Developer options.
| |
- enable
boolWhether to enable developer options. Default isfalse.- c4u
boolWhether to check for updates. Default isfalse.- githubToken
stringGitHub token. Please do not expose to public!- mDevtools
mapMobile Devtools Configuration.
- enable:
boolWhether to enable mobile devtools. Default isfalse. - type:
stringThe type of mobile devtools. The configuration value fortypecan 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/.
Related Content
Alipay
WeChat Pay
