Skip to content

Instantly share code, notes, and snippets.

@chalin
Created June 11, 2025 12:38
Show Gist options
  • Select an option

  • Save chalin/d06a26b956766692c56b998d87a2f39e to your computer and use it in GitHub Desktop.

Select an option

Save chalin/d06a26b956766692c56b998d87a2f39e to your computer and use it in GitHub Desktop.
Create a minimal Hugo site for testing
#!/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