From a12c5c791f6960831dbb7489e6b25ccb01879c56 Mon Sep 17 00:00:00 2001 From: jonathanpopham Date: Fri, 27 Feb 2026 22:26:52 -0500 Subject: [PATCH 1/2] fix: use Tree.Root.String() for JS/CSS extraction to avoid html/template escaping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RenderJS() and RenderCSS() were running static assets through html/template's Execute(), which HTML-escapes < to < 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. --- internal/pssg/render/render.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/pssg/render/render.go b/internal/pssg/render/render.go index 912d2db..dbb92f6 100644 --- a/internal/pssg/render/render.go +++ b/internal/pssg/render/render.go @@ -245,29 +245,23 @@ func (e *Engine) render(name string, data interface{}) (string, error) { } // RenderCSS reads and returns the CSS template content. +// Uses Tree.Root.String() to avoid html/template escaping in CSS code. func (e *Engine) RenderCSS() (string, error) { t := e.tmpl.Lookup("_styles.css") if t == nil { return "", nil } - var buf bytes.Buffer - if err := t.Execute(&buf, nil); err != nil { - return "", err - } - return buf.String(), nil + return t.Tree.Root.String(), nil } // RenderJS reads and returns the JS template content. +// Uses Tree.Root.String() to avoid html/template escaping < to < in JS code. func (e *Engine) RenderJS() (string, error) { t := e.tmpl.Lookup("_main.js") if t == nil { return "", nil } - var buf bytes.Buffer - if err := t.Execute(&buf, nil); err != nil { - return "", err - } - return buf.String(), nil + return t.Tree.Root.String(), nil } // GenerateCookModePrompt builds a cook-with-AI prompt for a recipe. From ff41ec1d0f44971a2e6e2b52c8f1a48e9fca2ac3 Mon Sep 17 00:00:00 2001 From: jonathanpopham Date: Mon, 2 Mar 2026 11:57:19 -0500 Subject: [PATCH 2/2] Add 'All Repos' link to site header navigation 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. --- templates/_header.html | 1 + templates/_styles.css | 2 ++ 2 files changed, 3 insertions(+) diff --git a/templates/_header.html b/templates/_header.html index 6733654..60fa8aa 100644 --- a/templates/_header.html +++ b/templates/_header.html @@ -8,6 +8,7 @@ {{.Site.Name}}