Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/lib/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function benchFromStore(
* untouched.
*/
function overlayEditorial(stored: Benchmark, spec: Spec): Benchmark {
return {
const overlaid: Benchmark = {
...stored,
seoTitle: spec.seo_title ?? stored.seoTitle,
seoDescription: spec.seo_description ?? stored.seoDescription,
Expand All @@ -92,6 +92,15 @@ function overlayEditorial(stored: Benchmark, spec: Spec): Benchmark {
// worker to rewrite the snapshot.
dimensions: spec.dimensions ?? stored.dimensions,
};
// Resolve `{{p50:slug}}`, `{{name:slug}}`, `{{best_name}}` etc. in the
// overlaid editorial text. Without this, a YAML edit that ships AHEAD
// of the next materialise sweep renders literal `{{p50:geckoterminal}}`
// tokens on the page because the stored snapshot was rendered against
// an older spec text (or never rendered at all on the fast path that
// hits overlayEditorial directly). The materialise sweep also passes
// its output through renderBenchmarkText; calling it here on the
// fallback path keeps the two paths consistent.
return renderBenchmarkText(overlaid);
}

// Per-bench unfiltered cache. ONE unstable_cache entry per slug so a
Expand Down
Loading