Hugo
Theme Doc - hextra
Theme-hextra
# an easy way?
hugo serve -D -t theme_name_here# Change directory to the theme folder
cd hextra-starter-template
# Start the server
hugo mod tidy
hugo server --logLevel debug --disableFastRender -p 1313
# Update the theme
hugo mod get -u
hugo mod tidy# start the server for draft
hugo server -DInstalling on mac
brew install hogoCreating
hugo new site first_siteInstalling & using themes
# within config.toml
theme = "the name of theme downloaded"content
hugo new a.mdList pages: if the folder is not the first folder level under content
# it must to be _index.md here
hugo new dir1/dir2/_index.mdarchetypes
- find if there exist the folder name within
archetypesthat correspond with the folder name withincontent - yes: use the specific markdown file; no: use the
default.md
Shortcodes
# /{/{/< shortcode-name param1 />/}/}
# e.g.
# /{/{/< youtube AnyYoutubeID />/}/}Tags & Categories
tags: ["tag1", "tag2", "tag3"]
categories: ["cat1"]Creating taxonomy
- Notice: modify
themes/ga-hugo-theme/layouts/_default/list.htmlby adding a new line for that namemood
mood: ["happy", "upset"]# hugo.toml
# even if tag and category are default, but we have to include them when we creating new taxonomies
# after modifyint he toml file, restart the server
[taxonomies]
tag = "tags"
category = "categories"
mood = "moods" Setting up Github Page
Cretea production repository
- the repository’s name has to be username.github.io
- it at least has one commit
git clone [email protected]:yixianwang/yixianwang.github.io.git
cd yixianwang.github.io
git checkout -b main
touch README.md
git status
git add .
git commit -m "adding readme"
git push origin mainAdd submodule
- Head to yixian-site folder
git submodule add -b main [email protected]:yixianwang/yixianwang.github.io.git publicDeploy the site
Generate public folder with static website
hugo # without draft
hugo -D # with draft
# or
# hugo -t theme_namePush
- Head to public folder
git add .
git commit -m "update"
git push origin main