Starter files for a Hugo theme with Tailwind CSS.
dev
or build
environmentbuild
, but not in dev
~light
, dark
or system
preferred color schemeLive long and code.
This theme is a starter setup theme to aid in developing Hugo themes using the Tailwind CSS framework. It is not a standalone theme ready to use.
Make sure to install postcss-cli
and autoprefixer
globally in your environment, as Hugo Pipe’s PostCSS requires it. This is mentioned in the Hugo Docs.
npm install -g postcss-cli
npm install -g autoprefixer
Make sure to use a minimum Hugo version of v0.120.0 and above.
git clone https://github.com/dirkolbrich/hugo-tailwindcss-starter-theme new-theme-name
cd new-theme-name
rm -rf .git
git init
npm install
hugo.toml
file in exampleSite/
to reflect the new-theme-name
# in hugo.toml
theme = "new-theme-name" # your new theme name here
exampleSite
hugo server -s exampleSite --themesDir=../.. --disableFastRender
hugo new site new-site
cd new-site/themes
git clone https://github.com/dirkolbrich/hugo-tailwindcss-starter-theme new-theme-name
cd new-theme-name
rm -rf .git
npm install
hugo.toml
file in new-site/
to reflect the new-theme-name# in hugo.toml
theme = "new-theme-name" # your new theme name here
cd new-site
hugo server --disableFastRender
Your content should go into new-site/content
, the development of the site layout is done within new-site/themes/new-theme-name/layout
.
Included are some helpers for the development phase (not visible in production):
/partials/dev/parameters.html
shows basic Hugo page parameters/partials/dev/size-indicator.html
displays a floating circle in the upper right corner to indicate the current Tailwind CSS responsive breakpoint/partials/dev/container-indicator.html
shows the container area as a color filled backgroundIf you don't need any of these helpers anymore, just delete the {{- partial "dev/dev-tools.html" . -}}
line from /layouts/_default/baseof.html
.