Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 3.11 KB

README.md

File metadata and controls

71 lines (49 loc) · 3.11 KB

Hugo Template

About

A ready out-of-the-box project to build your website using Hugo with GitHub Pages and GitHub Actions as Continuous Delivery.

In a local environment provide a Docker isolation with Traefik routing to avoid the ugly http://localhost:666/... url and reproduce a more consistent environment between CD and local development.

Dependencies

Set Up

In few steps you can have a cool website!

  1. Set values in .env

    1. HUGO_VERSION: The Hugo version which you will use. This really corresponds to Hugo Docker Image, check it out on its DockerHub.
    2. LOCAL_PORT: The local port of Hugo Server.
    3. LOCAL_DOMAIN: The local domain of Hugo Server. Must be ended with top domain .localhost!
    4. EXTERNAL_DOMAIN: Your domain for hosted page. This value is used to create a CNAME file in your build.
    5. GIT_DEPLOY_BRANCH: The output branch to host the website build for GitHub Pages. (Repo > Settings > Pages)
  2. Add your selected theme in the project! See more

  3. Fill and complete the config.toml file for your website.

    1. Config file
    2. Hugo Configuration Docs
  4. Check in the local environment your coolest website.

    1. Up the docker-compose. Using make: make up or raw method: docker-compose up -d --remove-orphans in your terminal.
    2. Open in your browser
  5. Enable the GitHub Pages in your repository and set the right DNS registers in your provider.

    1. Remember, the git branch must be the same that set in the .env file!
    2. GitHub Pages Docs
    3. GitHub Pages Custom DNS
  6. Cool! You're ready to publish your website!

    1. If you're working in a different branch that main, merge your changes in main branch to publish the website.
    2. Push your changes to GitHub git push origin main

How to configure

Hugo Server parameters

Open the docker-compose.yml file and check the value services.hugo.command.

GitHub Action Workflow

In the deploy-hugo.yml file contains all descriptors. Check the official documentation if you have any question.

License

Copyleft (ɔ) - Aran Moncusí Ramírez aran@digitalpoetinfo

This template is released under the GPL v3 License. Check it!