Skip to content

mydevopsteamio/workshop-gh-src

Repository files navigation

MyDevOpsTeam

MyDevOpsTeam.io Workshop GoHugo

MyDevOpsTeam Cloud Native

Github Pages

Environment Setup

Image Version
klakegg/hugo:0.107.0-ext-ubuntu-onbuild

Pulling Hugo Docker image:

docker pull klakegg/hugo:0.107.0-ext-ubuntu-onbuild

Clone this repo:

From wherever you checkout repos(or your fork):

git clone https://github.com/MyDevOpsTeam-io/workshop-gh-src.git

Specify Hugo theme:

git submodule add https://github.com/matcornic/hugo-theme-learn themes/hugo-theme-learn
echo "theme = 'hugo-theme-learn'" >> config.toml

Run Hugo locally:

docker run --rm -it \
    -v $(pwd):/src \
    -p 1313:1313 \
    klakegg/hugo:0.107.0-ext-ubuntu-onbuild \
  server --watch --disableFastRender

View Hugo locally:

Visit http://localhost:1313/ to see the site.

Making Edits:

As you save edits to a page, the site will live-reload to show your changes.

Building Hugo for production:

docker run --rm -it \
    -v $(pwd):/src \
    klakegg/hugo:0.107.0-ext-ubuntu-onbuild \
    --gc \
    --minify \
    --baseURL "https://workshops.mydevopsteam.io"

or proceed to Local Build

https://github.com/MyDevOpsTeam-io/workshop-gh-src.git
cd workshop-gh-src/tools
chmod +x build-hugo-prod-local.sh
./build-hugo-prod-local.sh

Commit Hooks

pre-commit installation:

sudo pip3 install pre-commit

Setup pre-commit hooks:

pre-commit install

Code Of Conduct

Please check read our code-of-conduct