Created
June 11, 2025 12:38
-
-
Save chalin/d06a26b956766692c56b998d87a2f39e to your computer and use it in GitHub Desktop.
Create a minimal Hugo site for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # A stripped down version of | |
| # https://github.com/google/docsy/blob/main/tools/make-site.sh | |
| set -eo pipefail | |
| : ${HUGO:=npx hugo} | |
| : ${SITE_NAME:="test-site"} | |
| set -x | |
| $HUGO new site --format yaml "$SITE_NAME" | |
| pushd "$SITE_NAME" > /dev/null | |
| cat > layouts/all.html << 'EOF' | |
| <!doctype html> | |
| <html> | |
| <head> </head> | |
| <body> | |
| <main> | |
| <h1>{{ .Title }}</h1> | |
| {{ .Content -}} | |
| </main> | |
| </body> | |
| </html> | |
| EOF | |
| # Clean up | |
| rm -Rf archetypes | |
| find . -type d -empty -delete | |
| # popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment