Skip to content

Commit ecaef2c

Browse files
authored
feat: curate landing-page examples to a featured subset (#114)
The landing page dumped all 40 example cards into its Render Result section, making it the longest scroll on the site (9948px at 1280px). A landing page should showcase, not enumerate - the full grid lives at /gallery/ with search, filters, and density controls since #113. Selection is data-driven: gallery.json entries may carry a featured_rank integer, build_site.py sorts by it into featured_examples, and the template renders that subset (falling back to the full list when nothing is curated). The panel counter is now honest about shown-vs-total ('8 of 40 frames'), and the gallery link moves from a below-the-fold footnote to a primary button above the grid. No controls on the landing page - that is what /gallery/ is for. Featured set (rank order): car-mirror-symmetry, soccer-ball-goldberg, damped-track-aim, light-link-studio, collision-hull-proxy, armature-bend, bmesh-gear, color-attribute-wheel - the pinned calibration members plus recent striking work, chosen for subject and palette range. Landing page height: 9948px -> 4847px at 1280px (-51%), 24788px -> 10203px at 390px (-59%). Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
1 parent 476e55b commit ecaef2c

3 files changed

Lines changed: 38 additions & 10 deletions

File tree

examples/gallery.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
"tags": [
8787
"mesh",
8888
"bmesh"
89-
]
89+
],
90+
"featured_rank": 7
9091
},
9192
{
9293
"name": "shader-node-group",
@@ -170,7 +171,8 @@
170171
"tags": [
171172
"constraints",
172173
"animation"
173-
]
174+
],
175+
"featured_rank": 3
174176
},
175177
{
176178
"name": "color-attribute-wheel",
@@ -183,7 +185,8 @@
183185
"mesh",
184186
"materials",
185187
"attributes"
186-
]
188+
],
189+
"featured_rank": 8
187190
},
188191
{
189192
"name": "parent-inverse-orrery",
@@ -219,7 +222,8 @@
219222
"tags": [
220223
"armature",
221224
"depsgraph"
222-
]
225+
],
226+
"featured_rank": 6
223227
},
224228
{
225229
"name": "text-version-stamp",
@@ -368,7 +372,8 @@
368372
"tags": [
369373
"rendering",
370374
"objects"
371-
]
375+
],
376+
"featured_rank": 4
372377
},
373378
{
374379
"name": "collision-hull-proxy",
@@ -380,7 +385,8 @@
380385
"tags": [
381386
"bmesh",
382387
"mesh"
383-
]
388+
],
389+
"featured_rank": 5
384390
},
385391
{
386392
"name": "custom-normals-shade",
@@ -456,7 +462,8 @@
456462
"tags": [
457463
"bmesh",
458464
"mesh"
459-
]
465+
],
466+
"featured_rank": 2
460467
},
461468
{
462469
"name": "car-mirror-symmetry",
@@ -468,7 +475,8 @@
468475
"tags": [
469476
"modifiers",
470477
"depsgraph"
471-
]
478+
],
479+
"featured_rank": 1
472480
},
473481
{
474482
"name": "attribute-domain-shear",

scripts/site/build_site.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ def load_examples(repo_root: Path) -> list[dict]:
250250
return examples
251251

252252

253+
def pick_featured(examples: list[dict]) -> list[dict]:
254+
"""Landing-page showcase subset: entries carrying a ``featured_rank``
255+
integer in gallery.json, sorted by rank. Returns [] when nothing is
256+
curated; the template then falls back to the full list."""
257+
return sorted(
258+
(ex for ex in examples if isinstance(ex.get("featured_rank"), int)),
259+
key=lambda ex: ex["featured_rank"],
260+
)
261+
262+
253263
def load_mcp_tools(repo_root: Path) -> list[dict]:
254264
mcp_file = repo_root / "mcp-tools.json"
255265
if not mcp_file.is_file():
@@ -365,6 +375,7 @@ def main():
365375
skills = parse_skills(repo_root)
366376
rules = parse_rules(repo_root)
367377
examples = load_examples(repo_root)
378+
featured = pick_featured(examples)
368379
mcp_tools = load_mcp_tools(repo_root)
369380
mcp_grouped = group_by_category(mcp_tools)
370381
changelog = parse_changelog(repo_root)
@@ -378,6 +389,8 @@ def main():
378389
"rule_count": len(rules),
379390
"examples": examples,
380391
"example_count": len(examples),
392+
"featured_examples": featured,
393+
"featured_count": len(featured),
381394
"snippet_count": len(plugin.get("snippets", [])),
382395
"template_count": len(plugin.get("templates", [])),
383396
# basenames for display: snippets/foo-bar.py -> foo-bar

scripts/site/template.html.j2

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@
153153
text-overflow: ellipsis; }
154154
.panel-cta { display: inline-block; margin-top: 1.25rem; font-weight: 500; font-size: 0.9rem; color: var(--select); }
155155
.panel-cta:hover { text-decoration: underline; }
156+
/* featured subset: gallery link is the section's primary call to action */
157+
.cta-row { margin: -0.25rem 0 1.5rem; }
158+
.btn-cta { display: inline-block; background: var(--select); color: #1a1b1e; font-weight: 500;
159+
font-size: 0.92rem; border-radius: 4px; padding: 0.55rem 1.15rem; transition: filter 0.15s; }
160+
.btn-cta:hover { filter: brightness(1.12); }
156161
157162
/* skills */
158163
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 2.25rem; }
@@ -284,19 +289,21 @@
284289
<main id="main">
285290

286291
{% if examples %}
292+
{% set shown = featured_examples if featured_examples else examples %}
287293
<section class="panel" id="examples">
288294
<div class="panel-head">
289295
<span class="caret" aria-hidden="true">&#9662;</span>
290296
<span class="hud">Render Result</span>
291-
<span class="hud count">{{ example_count }} frames</span>
297+
<span class="hud count">{% if featured_examples %}{{ featured_count }} of {% endif %}{{ example_count }} frames</span>
292298
</div>
293299
<div class="panel-body">
294300
<h2>Every render here is a CI artifact.</h2>
295301
<p class="lede">These aren't mockups. Each example runs headless on Blender 4.5 LTS and 5.1 in the
296302
smoke workflow, asserts its own correctness, and exits non-zero if the API drifted. The render is
297303
what the code produced.</p>
304+
<p class="cta-row"><a class="btn-cta" href="gallery/">Browse all {{ example_count }} examples in the gallery &rarr;</a></p>
298305
<div class="render-grid">
299-
{% for ex in examples %}
306+
{% for ex in shown %}
300307
<a class="render-card" href="gallery/{{ ex.name }}/">
301308
<img src="{{ ex.heroSite }}" alt="{{ ex.name }} render" loading="lazy" width="1280" height="720" />
302309
<div class="render-meta">

0 commit comments

Comments
 (0)