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:
[menu][[menu.main]]identifier=""# Identifier of the parent menu itemparent=""# you can add extra information before the name (HTML format is supported), such as iconspre=""# you can add extra information after the name (HTML format is supported), such as iconspost=""name=""url=""# title will be shown when you hover on this menu linktitle=""weight=1# add user-defined content to menu items[menu.main.params]# add css class to a specific menu itemclass=""# whether set as a draft menu item whose function is similar to a draft post/pagedraft=false# add fontawesome icon to a specific menu itemicon=""# set menu item type, optional values: ["mobile", "desktop"]type=""
Sub Menu
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:
1
2
3
4
5
6
7
8
9
10
11
12
---title:Theme Documentation - Basicsauthor:Lruihaomenu:main:name:Basicstitle:Discover what the Hugo - FixIt theme is all about and the core-concepts behind it.parent:documentationparams:icon:fa-brands fa-readme# ...---
[params]# FixIt theme versionversion="0.2.X"# e.g. "0.2.X", "0.2.15", "v0.2.15" etc.# site descriptiondescription="This is my new Hugo FixIt site"# site keywordskeywords=["Hugo","FixIt"]# site default theme ["light", "dark", "auto"]defaultTheme="auto"# public git repo url only then enableGitInfo is truegitRepo=""# which hash function used for SRI, when empty, no SRI is used# ["sha256", "sha384", "sha512", "md5"]fingerprint=""# date formatdateFormat="2006-01-02"# website images for Open Graph and Twitter Cardsimages=["/logo.png"]# enable PWAenablePWA=true# whether to add external Icon for external links automaticallyexternalIcon=false# 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.disableThemeInject=false# App icon config[params.app]# optional site title override for the app when added to an iOS home screen or Android launchertitle="FixIt"# whether to omit favicon resource linksnoFavicon=false# modern SVG favicon to use in place of older style .png and .ico filessvgFavicon=""# Safari mask icon coloriconColor="#5bbad5"# Windows v8-10 tile colortileColor="#da532c"# Android browser theme color[params.app.themeColor]light="#f8f8f8"dark="#252627"# Search config[params.search]enable=true# type of search engine ["lunr", "algolia", "fuse"]type="lunr"# max index length of the chunked contentcontentLength=4000# placeholder of the search barplaceholder=""# max number of results lengthmaxResultLength=10# snippet length of the resultsnippetLength=30# HTML tag name of the highlight part in resultshighlightTag="em"# whether to use the absolute URL based on the baseURL in search indexabsoluteURL=false[params.search.algolia]index=""appID=""searchKey=""[params.search.fuse]# https://fusejs.io/api/options.htmlisCaseSensitive=falseminMatchCharLength=2findAllMatches=falselocation=0threshold=0.3distance=100ignoreLocation=falseuseExtendedSearch=falseignoreFieldNorm=false# Header config[params.header]# desktop header mode ["sticky", "normal", "auto"]desktopMode="sticky"# mobile header mode ["sticky", "normal", "auto"]mobileMode="auto"# Header title config[params.header.title]# URL of the LOGOlogo="/fixit.min.svg"# title namename="My Hugo FixIt Site"# you can add extra information before the name (HTML format is supported), such as iconspre=""# you can add extra information after the name (HTML format is supported), such as iconspost=""# whether to use typeit animation for title nametypeit=false# Header subtitle config[params.header.subtitle]# subtitle namename=""# whether to use typeit animation for subtitle nametypeit=false# Breadcrumb config[params.breadcrumb]enable=falsesticky=falseshowHome=false# Footer config[params.footer]enable=true# Custom content (HTML format is supported)# For advanced use, see parameter `params.customFilePath.footer`custom=""# whether to show Hugo and theme infohugo=true# whether to show copyright infocopyright=true# whether to show the authorauthor=true# Site creation yearsince=2021# whether to show total word count of site contentwordCount=true# Public network security only in China (HTML format is supported)gov=""# ICP info only in China (HTML format is supported)icp=""# license info (HTML format is supported)license='<a rel="license external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'# Site creation time[params.footer.siteTime]enable=falseanimate=trueicon="fa-solid fa-heartbeat"pre=""value=""# e.g. "2021-12-18T16:15:22+08:00"# footer lines order, optional values: ["first", 0, 1, 2, 3, 4, 5, "last"][params.footer.order]powered=0copyright=0statistics=0visitor=0beian=0# Section (all posts) page config[params.section]# special amount of posts in each section pagepaginate=20# date format (month and day)dateFormat="01-02"# amount of RSS pagesrss=10# recently updated posts settings[params.section.recentlyUpdated]enable=falserss=falsedays=30maxCount=10# List (category or tag) page config[params.list]# special amount of posts in each list pagepaginate=20# date format (month and day)dateFormat="01-02"# amount of RSS pagesrss=10# TagCloud config for tags page[params.tagcloud]enable=falsemin=14# Minimum font size in pxmax=32# Maximum font size in pxpeakCount=10# Maximum count of posts per tagorderby="name"# Order of tags, optional values: ["name", "count"]# Home page config[params.home]# amount of RSS pagesrss=10# Home page profile[params.home.profile]enable=true# Gravatar Email for preferred avatar in home pagegravatarEmail=""# URL of avatar shown in home pageavatarURL="/images/avatar.png"# identifier of avatar menu linkavatarMenu=""# title shown in home page (HTML format is supported)title=""# subtitle shown in home pagesubtitle="This is my new Hugo FixIt site"# whether to use typeit animation for subtitletypeit=true# whether to show social linkssocial=true# disclaimer (HTML format is supported)disclaimer=""# Home page posts[params.home.posts]enable=true# special amount of posts in each home posts pagepaginate=6# Social config about the author[params.social]GitHub="Lruihao"Linkedin=""Twitter=""Instagram=""Facebook=""Telegram=""Medium=""Gitlab=""Youtubelegacy=""Youtubecustom=""Youtubechannel=""Tumblr=""Quora=""Keybase=""Pinterest=""Reddit=""Codepen=""FreeCodeCamp=""Bitbucket=""Stackoverflow=""Weibo=""Odnoklassniki=""VK=""Flickr=""Xing=""Snapchat=""Soundcloud=""Spotify=""Bandcamp=""Paypal=""Fivehundredpx=""Mix=""Goodreads=""Lastfm=""Foursquare=""Hackernews=""Kickstarter=""Patreon=""Steam=""Twitch=""Strava=""Skype=""Whatsapp=""Zhihu=""Douban=""Angellist=""Slidershare=""Jsfiddle=""Deviantart=""Behance=""Dribbble=""Wordpress=""Vine=""Googlescholar=""Researchgate=""Mastodon=""Thingiverse=""Devto=""Gitea=""XMPP=""Matrix=""Bilibili=""ORCID=""Liberapay=""Ko-Fi=""BuyMeaCoffee=""Linktree=""QQ=""QQGroup=""# https://qun.qq.com/join.htmlDiaspora=""CSDN=""Discord=""DiscordInvite=""Lichess=""Pleroma=""Kaggle=""MediaWiki=""Plume=""HackTheBox=""RootMe=""Feishu=""TryHackMe=""Phone=""Email=""RSS=true# Page config[params.page]# whether to enable the author's avatar of the postauthorAvatar=true# whether to hide a page from home pagehiddenFromHomePage=false# whether to hide a page from search resultshiddenFromSearch=false# whether to enable twemojitwemoji=false# whether to enable lightgallery# if set to "force", images in the content will be forced to shown as the gallery.lightgallery=false# whether to enable the ruby extended syntaxruby=true# whether to enable the fraction extended syntaxfraction=true# whether to enable the fontawesome extended syntaxfontawesome=true# license info (HTML format is supported)license='<a rel="license external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'# whether to show link to Raw Markdown content of the contentlinkToMarkdown=true# whether to show the full text content in RSSrssFullText=false# Page style ["narrow", "normal", "wide", ...]pageStyle="normal"# Gravatar is force-used as the author's avatar# gravatarForce = false# Auto Bookmark Support# If true, save the reading progress when closing the page.autoBookmark=false# whether to enable wordCountwordCount=true# whether to enable readingTimereadingTime=true# end of post flagendFlag=""# whether to enable instant.pageinstantPage=false# Repost config[params.page.repost]enable=falseurl=""# Table of the contents config[params.page.toc]# whether to enable the table of the contentsenable=true# whether to keep the static table of the contents in front of the postkeepStatic=false# whether to make the table of the contents in the sidebar automatically collapsedauto=true# position of TOC ["left", "right"]position="right"# Display a message at the beginning of an article to warn the reader that its content might be expired[params.page.expirationReminder]enable=false# Display the reminder if the last modified time is more than 90 days agoreminder=90# Display warning if the last modified time is more than 180 days agowarning=180# If the article expires, close the comment or notcloseComment=false# KaTeX mathematical formulas (https://katex.org)[params.page.math]enable=true# default inline delimiter is $ ... $ and \( ... \)inlineLeftDelimiter=""inlineRightDelimiter=""# default block delimiter is $$ ... $$, \[ ... \], \begin{equation} ... \end{equation} and some other functionsblockLeftDelimiter=""blockRightDelimiter=""# KaTeX extension copy_texcopyTex=true# KaTeX extension mhchemmhchem=true# Code config[params.page.code]# whether to show the copy button of the code blockcopy=true# whether to show the edit button of the code blockedit=true# the maximum number of lines of displayed code by defaultmaxShownLines=10# Post edit[params.page.edit]enable=false# Link for fork & edit# url = "/edit/branch-name/subdirectory-name" # base on `params.gitRepo`# url = "https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name" # full urlurl=""# Mapbox GL JS config (https://docs.mapbox.com/mapbox-gl-js)[params.page.mapbox]# access token of Mapbox GL JSaccessToken=""# style for the light themelightStyle="mapbox://styles/mapbox/light-v9"# style for the dark themedarkStyle="mapbox://styles/mapbox/dark-v9"# whether to add NavigationControlnavigation=true# whether to add GeolocateControlgeolocate=true# whether to add ScaleControlscale=true# whether to add FullscreenControlfullscreen=true# Donate (Sponsor) settings[params.page.reward]enable=falseanimation=false# position relative to post footer, optional values: ["before", "after"]position="after"# comment = "Buy me a coffee"# display mode of QR code images, optional values: ["static", "fixed"], default: `static`mode="static"[params.page.reward.ways]# wechatpay = "/images/wechatpay.png"# alipay = "/images/alipay.png"# paypal = "/images/paypal.png"# bitcoin = "/images/bitcoin.png"# social share links in post page[params.page.share]enable=trueTwitter=trueFacebook=trueLinkedin=falseWhatsapp=truePinterest=falseTumblr=falseHackerNews=falseReddit=falseVK=falseBuffer=falseXing=falseLine=trueInstapaper=falsePocket=falseDigg=falseStumbleupon=falseFlipboard=falseWeibo=trueRenren=falseMyspace=trueBlogger=trueBaidu=falseOdnoklassniki=falseEvernote=trueSkype=falseTrello=falseMix=false# Comment config[params.page.comment]enable=false# Artalk comment config (https://artalk.js.org/)[params.page.comment.artalk]enable=falseserver="https://yourdomain/api/"site="默认站点"placeholder=""noComment=""sendBtn=""editorTravel=trueflatMode="auto"maxNesting=3# enable lightgallery supportlightgallery=falselocale=""# # emoticons=""nestMax=2nestSort="DATE_ASC"# ["DATE_ASC", "DATE_DESC", "VOTE_UP_DESC"]vote=truevoteDown=falseuaBadge=truelistSort=trueimgUpload=truepreview=trueversionCheck=true# Disqus comment config (https://disqus.com)[params.page.comment.disqus]enable=false# Disqus shortname to use Disqus in postsshortname=""# Gitalk comment config (https://github.com/gitalk/gitalk)[params.page.comment.gitalk]enable=falseowner=""repo=""clientId=""clientSecret=""# Valine comment config (https://github.com/xCss/Valine)[params.page.comment.valine]enable=falseappId=""appKey=""placeholder=""avatar="mp"meta=""requiredFields=""pageSize=10lang=""visitor=truerecordIP=truehighlight=trueenableQQ=falseserverURLs=""# emoji data file name, default is "google.yml"# ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]# located in "themes/FixIt/assets/lib/valine/emoji/" directory# you can store your own data files in the same path under your project:# "assets/lib/valine/emoji/"emoji=""commentCount=true# # Waline comment config (https://waline.js.org)[params.page.comment.waline]enable=falseserverURL=""pageview=false# emoji=["//unpkg.com/@waline/emojis@1.1.0/weibo"]meta=["nick","mail","link"]requiredMeta=[]login="enable"wordLimit=0pageSize=10imageUploader=false# highlighter=false# comment=false# texRenderer=false# search=false# recaptchaV3Key=""# reaction=false# # Facebook comment config (https://developers.facebook.com/docs/plugins/comments)[params.page.comment.facebook]enable=falsewidth="100%"numPosts=10appId=""languageCode=""# Telegram comments config (https://comments.app)[params.page.comment.telegram]enable=falsesiteID=""limit=5height=""color=""colorful=truedislikes=falseoutlined=false# Commento comment config (https://commento.io)[params.page.comment.commento]enable=false# Utterances comment config (https://utteranc.es)[params.page.comment.utterances]enable=false# owner/reporepo=""issueTerm="pathname"label=""lightTheme="github-light"darkTheme="github-dark"# Twikoo comment config (https://twikoo.js.org/)[params.page.comment.twikoo]enable=falseenvId=""region=""path=""visitor=truecommentCount=true# enable lightgallery supportlightgallery=false# enable Katex supportkatex=false# Giscus comments config[params.page.comment.giscus]enable=falserepo=""repoId=""category=""categoryId=""mapping=""strict="0"# term=""reactionsEnabled="1"emitMetadata="0"inputPosition="bottom"# ["top", "bottom"]lightTheme="light"darkTheme="dark"lazyLoad=true# Third-party library config[params.page.library][params.page.library.css]# someCSS = "some.css"# located in "assets/"# Or# someCSS = "https://cdn.example.com/some.css"[params.page.library.js]# someJavascript = "some.js"# located in "assets/"# Or# someJavascript = "https://cdn.example.com/some.js"# Page SEO config[params.page.seo]# image URLimages=[]# Publisher info[params.page.seo.publisher]name=""logoUrl=""# TypeIt config[params.typeit]# typing speed between each step (measured in milliseconds)speed=100# blinking speed of the cursor (measured in milliseconds)cursorSpeed=1000# character used for the cursor (HTML format is supported)cursorChar="|"# cursor duration after typing finishing (measured in milliseconds, "-1" means unlimited)duration=-1# whether your strings will continuously loop after completingloop=false# Mermaid config[params.mermaid]# For values, see https://mermaid.js.org/config/theming.html#available-themesthemes=["default","dark"]# PanguJS config[params.pangu]# For Chinese writingenable=falseselector="article"# # Watermark config# Detail config see https://github.com/Lruihao/watermark#readme[params.watermark]enable=false# watermark's text (HTML format is supported)content=""# watermark's transparencyopacity=0.1# parent of watermark's containerappendTo=".wrapper>main"# watermark's width. unit: pxwidth=150# watermark's height. unit: pxheight=20# row spacing of watermarks. unit: pxrowSpacing=60# col spacing of watermarks. unit: pxcolSpacing=30# watermark's tangent angle. unit: degrotate=15# watermark's fontSize. unit: remfontSize=0.85# watermark's fontFamilyfontFamily="inherit"# Busuanzi count[params.ibruce]enable=true# Enable in post metaenablePost=false# Site verification code config for Google/Bing/Yandex/Pinterest/Baidu/360/Sogou[params.verification]google=""bing=""yandex=""pinterest=""baidu=""so=""sogou=""# Site SEO config[params.seo]# image URLimage=""# thumbnail URLthumbnailUrl=""# Analytics config[params.analytics]enable=false# Google Analytics[params.analytics.google]id=""# whether to anonymize IPanonymizeIP=true# Fathom Analytics[params.analytics.fathom]id=""# server url for your tracker if you're self hostingserver=""# Cookie consent config[params.cookieconsent]enable=true# text strings used for Cookie consent banner[params.cookieconsent.content]message=""dismiss=""link=""# CDN config for third-party library files[params.cdn]# CDN data file name, disabled by default ["jsdelivr.yml", "unpkg.yml", ...]# located in "themes/FixIt/assets/data/cdn/" directory# you can store your own data files in the same path under your project: "assets/data/cdn/"# data = "unpkg.yml"# Compatibility config[params.compatibility]# whether to use Polyfill.io to be compatible with older browserspolyfill=false# whether to use object-fit-images to be compatible with older browsersobjectFit=false# GitHub banner in the top-right or top-left corner[params.githubCorner]enable=falsepermalink="https://github.com/hugo-fixit/FixIt"title="View source on GitHub"position="right"# ["left", "right"]# Gravatar config[params.gravatar]# Depends on the author's email, if the author's email is not set, the local avatar will be usedenable=false# Gravatar host, default: "www.gravatar.com"host="www.gravatar.com"# ["cn.gravatar.com", "gravatar.loli.net", ...]style=""# ["", "mp", "identicon", "monsterid", "wavatar", "retro", "blank", "robohash"]# Back to top[params.backToTop]enable=true# Scroll percent label in b2t buttonscrollpercent=false# Reading progress bar[params.readingProgress]enable=false# Available values: ["left", "right"]start="left"# Available values: ["top", "bottom"]position="top"reversed=falselight=""dark=""height="2px"# Progress bar in the top during page loading# For more information: https://github.com/CodeByZach/pace[params.pace]enable=false# All available colors:# ["black", "blue", "green", "orange", "pink", "purple", "red", "silver", "white", "yellow"]color="blue"# 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"]theme="minimal"# Define custom file paths# Create your custom files in site directory `layouts/partials/custom` and uncomment needed files below[params.customFilePath]# aside = "custom/aside.html"# profile = "custom/profile.html"# footer = "custom/footer.html"# Developer options[params.dev]enable=false# Check for updatesc4u=false# Please do not expose to public!githubToken=""# Mobile Devtools config[params.dev.mDevtools]enable=false# "vConsole", "eruda" supportedtype="vConsole"# Markup related configuration in Hugo[markup]# Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)[markup.highlight]########## necessary configurations ########### https://github.com/hugo-fixit/FixIt/issues/43codeFences=truelineNos=truelineNumbersInTable=truenoClasses=false########## necessary configurations ##########guessSyntax=true# Goldmark is from Hugo 0.60 the default library used for Markdown[markup.goldmark][markup.goldmark.extensions]definitionList=truefootnote=truelinkify=truestrikethrough=truetable=truetaskList=truetypographer=true[markup.goldmark.renderer]# whether to use HTML tags directly in the documentunsafe=true# Table Of Contents settings[markup.tableOfContents]startLevel=2endLevel=6# Author config[author]name="xxxx"email=""link=""avatar="/images/avatar.png"# # Sitemap config[sitemap]changefreq="weekly"filename="sitemap.xml"priority=0.5# Permalinks config (https://gohugo.io/content-management/urls#permalinks)[Permalinks]# posts = ":year/:month/:filename"posts=":filename"# Privacy config (https://gohugo.io/about/hugo-and-gdpr/)[privacy][privacy.twitter]enableDNT=true[privacy.youtube]privacyEnhanced=true# [mediaTypes]# Options to make output .md files[mediaTypes."text/markdown"]suffixes=["md"]# Options to make output .txt files[mediaTypes."text/plain"]suffixes=["txt"]# [outputFormats]# Options to make output .md files[outputFormats.MarkDown]mediaType="text/markdown"isPlainText=trueisHTML=false# Options to make output baidu_urls.txt file[outputFormats.BaiduUrls]baseName="baidu_urls"mediaType="text/plain"isPlainText=trueisHTML=false# Options to make hugo output files[outputs]home=["HTML","RSS","JSON","BaiduUrls"]page=["HTML","MarkDown"]section=["HTML","RSS"]taxonomy=["HTML","RSS"]taxonomyTerm=["HTML"]
CDN Configuration
1
2
3
[params.cdn]# CDN data file name, disabled by default ["jsdelivr.yml", "unpkg.yml", ...]data=""
The default CDN data file is located in themes/FixIt/assets/data/cdn/ directory.
You can store your own data file in the same path under your project: assets/data/cdn/.
Social Configuration
You can directly set your ID to get a default social link and its icon:
1
2
[params.social]Mastodon="@xxxx"
The social link generated is https://mastodon.technology/@xxxx.
Or You can set more options through a dict:
1
2
3
4
5
6
7
8
9
10
[params.social][params.social.Mastodon]# weight when arranging icons (the greater the weight, the later the icon is positioned)weight=0# your social IDid="@xxxx"# prefix of your social linkprefix="https://mastodon.social/"# content hovering on the icontitle="Mastodon"
The default data of all supported social links is located in themes/FixIt/assets/data/social.yaml,
which is you can refer to.
In order to generate index.json for searching, add JSON output file type to the home of the outputs part in your site configuration, see params.search configuration in Theme Configuration for details.
1
2
[outputs]home=["HTML","RSS","JSON"]
Tips about algolia
You need to upload index.json files to algolia to activate searching.
You could upload the index.json files by browsers but a CLI tool may be better.
Algolia Atomic is a good choice.
To be compatible with Hugo multilingual mode,
you need to upload different index.json for each language to the different index of algolia, such as zh-cn/index.json or fr/index.json…
# [en, zh-cn, fr, pl, ...] determines default content languagedefaultContentLanguage="en"[languages][languages.en]weight=1title="My Hugo FixIt Site"languageCode="en"languageName="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=2title="我的 Hugo FixIt 网站"# language code, CN only herelanguageCode="zh-CN"languageName="简体中文"# whether to include Chinese/Japanese/KoreanhasCJKLanguage=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=3title="Mon nouveau site Hugo FixIt"languageCode="fr"languageName="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
Be aware that only translated pages are displayed in menu. It’s not replaced with default language content.
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!