Conversation
Remove static directory from gitignore while keeping specific files. No longer need this because we're not tossing generated templates in here.
There was a problem hiding this comment.
Pull request overview
Migrates the website pages from PHP-generated static HTML to server-side rendered Go templates using github.com/a-h/templ, and wires the new pages into the Go HTTP router.
Changes:
- Add
.templsources (and generated*_templ.gooutputs) forindex,dashboard,privacy, plus sharedHead/Header/Footer/Shieldcomponents. - Replace PHP page rendering and static HTML generation with
templ.Handler(...)routes incmd/shielded/main.go. - Update build tooling to run
go generate(templ codegen) duringmake build, and add templ/tool dependencies togo.mod/go.sum.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pages/privacy_templ.go | Generated templ output for Privacy page. |
| pages/privacy.templ | New Privacy page source template. |
| pages/privacy.html.php | Removes old PHP version of Privacy page. |
| pages/index_templ.go | Generated templ output for Index page. |
| pages/index.templ | New Index page source template. |
| pages/index.html.php | Removes old PHP version of Index page. |
| pages/dashboard_templ.go | Generated templ output for Dashboard page. |
| pages/dashboard.templ | New Dashboard page source template. |
| pages/dashboard.html.php | Removes old PHP version of Dashboard page. |
| pages/common_templ.go | Generated shared components + helpers/types used by pages. |
| pages/common.templ | Source for shared components + helper funcs/types. |
| pages/_head.php | Removes old PHP head partial. |
| pages/_header.php | Removes old PHP header partial. |
| pages/_footer.php | Removes old PHP footer partial. |
| cmd/shielded/main.go | Adds go:generate for templ + serves new templ pages via router. |
| Makefile | Runs go generate and stops generating static HTML via PHP. |
| go.mod | Adds templ dependency and pins templ tool. |
| go.sum | Adds sums for new templ-related dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import ( | ||
| "net/url" | ||
|
|
||
| gotempl "github.com/a-h/templ" | ||
| ) |
There was a problem hiding this comment.
common.templ imports github.com/a-h/templ as gotempl, but the generated file also imports the same package unaliased (import "github.com/a-h/templ"), resulting in a duplicate import path in pages/common_templ.go and a Go compile error. Remove the explicit templ import/alias from this .templ file and use the generator-provided templ package for SafeURL/URL (keep only the net/url import here).
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Fixed in c30f45b. Removed the gotempl "github.com/a-h/templ" alias import from common.templ and updated dnsPrefetchURL/shieldURL to use the generator-provided templ.SafeURL and templ.URL. Regenerated common_templ.go — the duplicate import is gone and the build compiles cleanly.
…mpl package Agent-Logs-Url: https://github.com/ShieldedDotDev/shieldeddotdev/sessions/b43930eb-8742-4baf-9a50-d1cdf95e43af Co-authored-by: donatj <133747+donatj@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ShieldedDotDev/shieldeddotdev/sessions/b43930eb-8742-4baf-9a50-d1cdf95e43af Co-authored-by: donatj <133747+donatj@users.noreply.github.com>
No description provided.