Creating a Hugo (open-source static site generators) project with docker
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| archives | ||
| conf | ||
| .env | ||
| .gitignore | ||
| docker-compose.yml | ||
| init-hugo.sh | ||
| LICENSE | ||
| MEMO.md | ||
| README.md | ||
Creating a Hugo (open-source static site generators) project with docker
INSTALLATION
Create directory
mkdir -pv ${PWD}/{cache,src}
Create a Hugo site
# Linux
docker run -it --name hugo-new-site-generator -v ./src:/src -v ./cache:/tmp/hugo_cache hugomods/hugo:latest hugo new site . --format yaml
docker run -it --name hugo-new-site-generator -v ./src:/src -v ./cache:/tmp/hugo_cache hugomods/hugo:ci-0.152.2 hugo new site . --format yaml
# Windows
docker run -it --name hugo -v C:/Users/<user>/Documents/Docker/hugo-stack/hugo/src:/src -v C:/Users/<user>/Documents/Docker/hugo-stack/hugo/cache:/tmp/hugo_cache hugomods/hugo:latest hugo new site quickstart --format yaml
Docker compose
docker compose up -d
Install Hugo Theme
docker exec -it hugo sh
Inside Hugo container :
/src $ git clone https://github.com/onweru/compose/ themes/compose
/src $ cp -a themes/compose/exampleSite/* .
hugo new site .
cd .
git init
git submodule add https://github.com/onweru/compose/ themes/compose
cp -a themes/compose/exampleSite/* .
git commit -m "setup compose theme"
Create content
docker exec -it hugo hugo new index.md
xxxxxxxxx
XXXXX
xxxxxxxxx
XXXXX
XXXXX
XXXXX