Skip to content
Snippets Groups Projects
Select Git revision
  • 59811c1d8b051402d5e46b69ea762a1952202c38
  • master default protected
  • dev
3 results

about.txt

Blame
  • README.md 4.65 KiB

    Example Hugo website using GitLab Pages.

    Learn more about GitLab Pages at the official documentation.

    GitLab CI/CD

    This project's static Pages are built by GitLab CI/CD, following the steps defined in .gitlab-ci.yml.

    Building locally

    To work locally with this project, you'll have to follow the steps below:

    1. Fork, clone or download this project.

    2. Install git and go.

    3. Install Hugo.

    4. Install the theme as a Hugo module:

      hugo mod init gitlab.com/pages/hugo
      hugo mod get -u github.com/theNewDynamic/gohugo-theme-ananke
    5. Preview your project:

      hugo server
    6. Add content.

    7. Optional. Generate the website:

      hugo

    Read more at Hugo's documentation.

    Use a custom theme

    Hugo supports a variety of themes.

    Visit https://themes.gohugo.io/ and pick the theme you want to use. In the Pages example, we use https://themes.gohugo.io/themes/gohugo-theme-ananke/.

    Use a custom theme using a Hugo module

    The example .gitlab-ci.yml uses Hugo modules to import the theme.

    To use your own theme:

    1. Edit .gitlab-ci.yml, and replace the URL in the hugo mod get line with the URL of your theme:

      - hugo mod get -u github.com/theNewDynamic/gohugo-theme-ananke
    2. Edit config.toml and add the theme:

      theme = ["github.com/theNewDynamic/gohugo-theme-ananke"]

    hugo vs hugo_extended

    The Container Registry contains two kinds of Hugo Docker images, hugo and hugo_extended. Their main difference is that hugo_extended comes with Sass/SCSS support. If you don't know if your theme supports it, it's safe to use hugo_extended since it's a superset of hugo.

    The Container Registry contains three repositories:

    • registry.gitlab.com/pages/hugo
    • registry.gitlab.com/pages/hugo/hugo
    • registry.gitlab.com/pages/hugo/hugo_extended

    pages/hugo:<version> and pages/hugo/hugo:<version> are effectively the same. hugo_extended was created afterwards, so we had to create the pages/hugo/ namespace.