Skip to content

Add 'All Repos' nav link back to homepage#14

Merged
jonathanpopham merged 2 commits intomainfrom
feat/back-to-all-repos
Mar 3, 2026
Merged

Add 'All Repos' nav link back to homepage#14
jonathanpopham merged 2 commits intomainfrom
feat/back-to-all-repos

Conversation

@jonathanpopham
Copy link
Contributor

@jonathanpopham jonathanpopham commented Mar 2, 2026

Summary

  • Adds an "← All Repos" link as the first item in the site header nav on every page
  • Links to repos.supermodeltools.com so users can navigate back to the full repo listing
  • Styled with accent color and a right border separator to distinguish it from in-repo nav

Context

Repos like volt have arch-docs pages but users couldn't get back to the main listing to discover other repos. This was raised when Abraham couldn't find volt from the homepage.

Changes

File Change
templates/_header.html Add ← All Repos link before "By Type"
templates/_styles.css Add .nav-all-repos style (accent color, border separator)

Test plan

  • Build a repo with arch-docs and verify the link appears in the header
  • Verify it links to https://repos.supermodeltools.com/
  • Verify existing nav links (By Type, Domains, etc.) are unaffected
  • Check mobile layout — nav scrolls horizontally as before

Summary by CodeRabbit

  • New Features
    • Added "All Repos" navigation link in the site header, providing quick access to the external repositories page.
    • Link includes accent color styling, hover effects, and optimized spacing for seamless integration with existing navigation design.

…ate escaping

RenderJS() and RenderCSS() were running static assets through
html/template's Execute(), which HTML-escapes < to &lt; in the output.
This broke all for-loops and comparisons in main.js (8 instances),
causing a syntax error that prevented all D3 graphs from rendering.

Same root cause as the template.HTML → template.JS fix: the
text/template → html/template migration in 8f1470b.
Adds a link back to repos.supermodeltools.com as the first item
in the nav bar on every page. Styled with accent color and a
subtle right border to separate it from the in-repo nav links.
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Walkthrough

This pull request modifies CSS and JS template rendering to bypass HTML escaping by returning raw template strings, adds a new "All Repos" navigation link to the site header, and applies corresponding styling for the new navigation item.

Changes

Cohort / File(s) Summary
Rendering Logic
internal/pssg/render/render.go
Changed RenderCSS and RenderJS to return raw template tree strings (t.Tree.Root.String()) instead of executing templates into buffers, avoiding html/template escaping for CSS/JS content.
Frontend Navigation & Styling
templates/_header.html, templates/_styles.css
Added new "← All Repos" navigation link pointing to repos.supermodeltools.com with class nav-all-repos, and applied accompanying CSS styling including color, padding, margin, border properties, and hover state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🎨 A link to all repos now greets the weary eye,
Template strings flow raw, no HTML in disguise,
With borders and colors that softly comply,
Navigation grows richer—a practical prize! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add 'All Repos' nav link back to homepage' directly matches the main objective: adding a navigation link to return to the repository listing. It's clear, concise, and captures the primary change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/back-to-all-repos

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
internal/pssg/render/render.go (1)

248-265: Good catch, but asset templates are currently action-free—so this approach is safe for now.

The concern is solid: using t.Tree.Root.String() (lines 254 and 264) skips normal template execution. If someone later adds {{.Site.Name}} to _main.js or _styles.css, it'd ship literally instead of being rendered.

That said, both files today have zero template actions, so there's no immediate problem. If this pattern stays (CSS and JS stay template-free), you're golden.

The one thing worth considering: if these asset files might grow template logic someday, document that expectation somewhere (a comment, code review template, or architectural note). That way, future devs know "don't add {{...}} in here."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/pssg/render/render.go` around lines 248 - 265, RenderCSS and
RenderJS currently return raw template source using t.Tree.Root.String(), which
bypasses template execution and will cause any future template actions in
"_styles.css" or "_main.js" to be shipped literally; update these functions'
documentation by adding a clear comment above RenderCSS and RenderJS stating
that these asset templates must not contain template actions (e.g., {{...}}) and
that any dynamic content should use regular templates rendered via
e.tmpl.Execute/ExecuteTemplate instead, referencing the functions RenderCSS,
RenderJS and the asset names "_styles.css" and "_main.js" so future authors know
not to add template logic here.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/pssg/render/render.go`:
- Around line 248-265: RenderCSS and RenderJS currently return raw template
source using t.Tree.Root.String(), which bypasses template execution and will
cause any future template actions in "_styles.css" or "_main.js" to be shipped
literally; update these functions' documentation by adding a clear comment above
RenderCSS and RenderJS stating that these asset templates must not contain
template actions (e.g., {{...}}) and that any dynamic content should use regular
templates rendered via e.tmpl.Execute/ExecuteTemplate instead, referencing the
functions RenderCSS, RenderJS and the asset names "_styles.css" and "_main.js"
so future authors know not to add template logic here.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e08478 and ff41ec1.

📒 Files selected for processing (3)
  • internal/pssg/render/render.go
  • templates/_header.html
  • templates/_styles.css

@jonathanpopham jonathanpopham merged commit 11d0283 into main Mar 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant