Install
brew install hugo
hugo new site spacedust --format yaml
cd spacedust
git init
git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
# clone your repository with its submodule
git clone --recurse-submodules ${repository}
# initialize and update submodules (if you cloned it without submodules)
git submodule update --init
Repository
Git repository mupofps/hugo-spacedust in Gare.
Archetypes
archetypes/default.md with YAML front matter from Hugo.
---
date: '{{ .Date }}'
draft: true
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
tags: ['{{ replace .File.ContentBaseName `-` ` ` }}']
---
Home
hugo.yaml
params:
homeInfoParams:
Title: "Hello ๐ "
Content: |

Welcome to "Space Dust"!
There is the blog of Mu Jiang.
assets/css/extended/custom.css
img[alt='Home Image'] {
max-width: 100%;
border-radius: var(--radius);
margin: 0px 0px 0px 0px;
}
CLI
pass environment variables
env HUGO_TITLE="Some Title" hugo
show drafts
hugo server --bind "$interface_ip" -b "$url" -D
build the site
hugo -b "$url"
watch for changes
hugo -b "$url" -w
clear obsolete files
hugo -b "$url" --cleanDestinationDir
Access Key
c - ToC Open/Close
g - Go To Top
h - Home (according to current lang)
t - Theme toggle
/ - Jumps to search page if in menu
Modifier on Windows, FreeBSD, and Linux (Chrome): Alt or Alt + Shift
Modifier on macOS (Safari or Chrome): control + option
Mathematics
Add these two files to layouts/partials/.
โโโ layouts
โย ย โโโ partials
โย ย โโโ extend_head.html
โย ย โโโ math.html
extend_head.html form PaperMod
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
math.html form Katex
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
Examples:
- Inline type \( \beta = \alpha -\gamma \)
- Block type $$ \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$
Share Icons
Add more share icons which is modified by Inkscape. Check share_icons.html for details.
Social Media
More social media icons: weibo, qq, qzone, douban. The icons are from Simple Icons.
Copy to Clipboard
Click clipboard icon to copy the post url. The icons are from Feather.
QR Code
Click QR code icon to go to the qrcode page.
- The icon is generated with text “QR” by qrcode-svg.
- The QR code generator
static/qrcodejs/qrcode.min.jsis from davidshimjs / qrcodejs. - The qrcode page use the query string
?text=*to get contents. Check its layout qrcode.html for details.
P.S.
The icon of Space Dust is form MDI project and the home image of it is from Unsplash.