--- title: Hugo in 5 minutes tags: Templates, Talk description: View the slide with "Slide Mode". --- ![](https://d33wubrfki0l68.cloudfront.net/c38c7334cc3f23585738e40334284fddcaf03d5e/2e17c/images/hugo-logo-wide.svg) # Hugo in 5 minutes --- ## Why static site generator? - simple (I mean, really simple) compared to Drupal - energy efficiency - free hosting --- ## Why HUGO? [comment]: <> (There are several static site generators...) - written in Go (developers provide static binaries for all OSs) - on Linux and MacOS installation done by `brew install hugo` - feature-complete - image transformations - asset (JS, SCSS) compilation - Go templates (somewhat similar to Twig) - very fast (allows hot reloading during development) --- ## Automatic builds - you don't need to use CLI to rebuild site manually when updating content - Github, Gitlab and Bitbucket provide pipelines - Github pages example: ``` name: push commit to github pages on: push: branches: - master jobs: build-deploy: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 lfs: true - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: hugo-version: '0.70.0' extended: true - name: Build run: hugo --minify - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} publish_dir: ./public publish_branch: gh-pages # deploying branch ``` --- ## Going further - https://gohugo.io/documentation/ - https://themes.gohugo.io/ - CMSs: - https://forestry.io - https://www.netlifycms.org/