This document shows a brief guide to setup hugo-theme-monochrome in your hugo project.
Quick Start
Install Hugo
You need “extended” version of hugo to support SASS. Checkout Install Hugo for more details.
Take Linux for example:
| |
The minimum hugo version that hugo-theme-monochrome required is
0.80.0
Create a New Site
| |
Add a Theme
| |
Then add theme = "hugo-theme-monochrome" to your config.toml
Setup Dependencies
Prepare a composite package.json file for your project.
| |
Install dependencies
| |
Remember to ignore
node_modulesfolder
Setup PostCSS
hugo-theme-monochrome is powered by tailwindcss. For better quality of CSS purging in production, you should add the following config to your config.toml, or the default settings generated from demo site will be applied.
See CSS purging with PostCSS for more details.
| |
Customize the Theme
See Configuration.
Start the Hugo server
| |
Minify CSS and JS resources, PurgeCSS will also be applied. The minifier of JavaScript here is powered by ESBuild.
| |
Build static pages
Generate files to /public folder, --minify option can minify other resouces (e.g. HTML/XML/JSON…).
See Configure Minify to adjust the behavior of hugo minifier (powered by minify).
| |
Deployment
Push /public folder to your server. This site is built by using Github Action and Github Pages. The CI script is available here.
Run exampleSite
| |
