diff --git a/.gitignore b/.gitignore index ee20c6b..70995fa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ hugo_stats.json # Executable may be added to repository +hugo hugo.exe hugo.darwin hugo.linux diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9825e2..929c7a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,15 @@ +## Environment Setup + +1. Download a [Hugo](https://gohugo.io/installation/) binary to `./hugo` + (v0.147.0 or later) + - Ubuntu: `make setup-ubuntu` +2. Pull all the git submodules: `git submodule update --init --recursive` +3. Run the site locally: `make run` -> https://localhost:1313 + +Hugo auto-reloads the site to match your local changes, so you are ready to +start developing! + + ## Adding a new announcement 1. Choose a title for your announcement in [kebab-case](https://developer.mozilla.org/en-US/docs/Glossary/Kebab_case) (e.g. `my-custom-announcement`) diff --git a/Makefile b/Makefile index 1982775..70e0cd6 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,27 @@ .PHONY: all -title ?= my-announcement +hugo_version ?= 0.147.0 +setup-ubuntu: +# The `hugo` download contains a LICENSE and README.md file. +# +# Extracting to a tmp folder protects against overwriting this project's +# LICENSE and README.md + mkdir -p ./tmp + wget -O - https://github.com/gohugoio/hugo/releases/download/v$(hugo_version)/hugo_extended_$(hugo_version)_linux-amd64.tar.gz \ + | tar -xz --directory ./tmp + mv ./tmp/hugo ./hugo + rm -rf ./tmp +title ?= my-announcement announcement: - hugo new content $(title)/index.md + ./hugo new content $(title)/index.md clean: - rm -r public - rm -r resources + rm -rf public + rm -rf resources build: - hugo \ No newline at end of file + ./hugo + +run: + ./hugo server --bind 0.0.0.0 \ No newline at end of file