Note: Further development suspended as of 2021-09-11 but, on 2021-11-02, I went back in and made the repo compatible with Tailwind CSS’s just-in-time (JIT) mode. For details on how I did this, see “Making Tailwind JIT work with Hugo.”
This is a starter set for the Hugo static site generator (SSG), based on the look-and-feel of my website at brycewray.com. Note: This repo does NOT use Hugo Modules.
See the online demo.
- Clone this to a local repo.
- Make appropriate changes to
config.yaml
to conform to your site’s parameters. - Run
npm install
to load all the dependencies inpackage.json
. - Once you have installed Hugo, run
npm run start
from your terminal app. You can then view the site in http://localhost:1313 on your computer. - Read the sample posts and their Markdown files to see how everything works.
- Edit the content to make it your own!
- When ready, deploy the site to your chosen host. The
build
command isnpm run build
. (For local testing, you can usenpm run testbuild
to set the environment toproduction
; see “What’s under the hood,” below.)
For Hugo users unused to dealing with JavaScript from Node.js plugins and dependencies, this repo may not be your cup of tea, and that’s perfectly understandable.* However, if you’re willing to take a trip to the Dark Side, it does offer some interesting add-on possibilities. (That said, Hugo’s single-binary, nearly-everything-out-of-the-box approach has served it well and is impressive.) In package.json
, you’ll find dependencies that make possible the use of PostCSS and Tailwind CSS.
In addition, there’s:
- Lazy-loading of in-body images through use of lazyload.
- Responsive images through Hugo’s built-in image processing capabilities, using code borrowed shamelessly (and, where necessary, adapted for later versions of Hugo) from Stereobooster’s “Responsive images for Hugo” and Strict Panda’s “Using Image Processing to Load Images in Hugo.” (The real site’s repo uses Cloudinary rather than having the images in the repo and processing them as such.)
* If you don’t care for dealing with Node.js dependencies, you may be interested in another Hugo repo, hugo_solo, which offers the same lazy-loading and image processing but uses SCSS through Hugo Pipes instead of Tailwind CSS and PostCSS.