Thank you for your interest in contributing to StructPages!
- Go 1.24.3 or later
- Templ CLI for working with examples
To ensure code quality and consistency, set up pre-commit hooks for automatic code formatting and linting:
./scripts/setup-hooks.shThis will configure git to run goimports, gofmt, and golangci-lint before each commit.
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run tests with verbose output
go test -v ./...
# Run a specific test
go test -run TestName ./...# Navigate to an example
cd examples/simple # or examples/htmx or examples/todo
# Install dependencies
go mod download
# Generate Go code from Templ files (required before running)
templ generate -include-version=false
# Run the example server (typically on :8080)
go run main.go
# Watch mode for Templ files during development
templ generate --watch- Follow standard Go conventions and idioms
- Write tests for new functionality
- Update documentation when adding features
- Keep commits focused and atomic
- Write clear commit messages
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and ensure they pass
- Commit your changes (pre-commit hooks will run automatically)
- Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
The documentation site lives on an orphan branch docs-site (Docusaurus machinery only — no markdown content, which is pulled from main at build time). The deploy workflow on main (.github/workflows/docs.yml) handles the build.
git fetch origin docs-site
git worktree add website docs-site
cd website
npm install/website/ is gitignored on main, so the worktree doesn't pollute the index.
Edit on main as usual. A push to main that touches docs/**, examples/README.md, *.go (non-test), README.md, or PERFORMANCE.md triggers a rebuild.
To preview locally before pushing:
cd website
# Copy current main-branch content into the worktree's docs/ folder:
cp ../docs/*.md docs/
mkdir -p docs/about && cp ../PERFORMANCE.md docs/about/performance.md
npm run startOpen http://localhost:3000/structpages/.
Work in the website/ worktree on the docs-site branch. Commit and push there:
cd website
git add .
git commit -m "chore(docs-site): ..."
git push origin docs-siteThen trigger a deploy from the Actions tab (Docs Site workflow → Run workflow on main) since pushes to docs-site don't auto-fire the workflow (it's defined on main).
Feel free to open an issue on GitHub if you have questions or run into problems.