/hugorepo

My favourite files for building websites with Hugo.

Primary LanguageHTMLDo What The F*ck You Want To Public LicenseWTFPL

Hugorepo

My favourite files for making websites with Hugo.

Features

  • Stripped-down, boilerplate structure
  • Works as a starting point for a theme
  • Rich, semantic HTML (with templates featuring OpenGraph, Schema.org, Dublin Core)
  • Clean, basic markup for the basic pages (list, single)
  • Useful code snippets, such as menu templates
  • Write more effective CSS with PostCSS (Autoprefixer, nested SASS-like syntax, purgeCSS, import)
  • Ready for TailwindCSS

๐Ÿ›  Install

Requires NodeJS v10+ (to build assets with PostCSS-CLI).

npm install

๐Ÿ’ป Local

Start a local server (http://localhost:1313 by default):

npm run serve  # hugo serve --disableFastRender --buildDrafts --buildFuture

๐Ÿ“ฆ Production

Build the site in the public/ directory:

npm run build  # rm -rf public && hugo --minify

๐Ÿš€ Deploy

Once the files are built in public/, itโ€™s only a matter of copying them to the webserver. There are many ways to achieve this. Hereโ€™s a simple solution using Rsync.

Rsync

Transfer the files using Rsync. This requires prior editing of the commands/deploy.sh file to match your configuration.

npm run deploy  # ./commands/deploy.sh

Shortcodes

๐Ÿ–ผ img

{{< img src="/path/to/img.jpg" class="custom-class" title="Title (optional)" caption="Caption (optional)" >}}

Params:

  • alt (string): alternative text if image cannot be displayed.
  • class (string): add a class to the <figure> object.
  • caption (string): optional caption. Also translates to the alt img attribute
  • src (string): path to image. Must be an absolute path or relative to project root.
  • title (string): optional title.

License

WTFPL