Make the AI blog the front page; move the prompt library to library.html - #4
Open
SarutobiSasuke8 wants to merge 6 commits into
Open
Make the AI blog the front page; move the prompt library to library.html#4SarutobiSasuke8 wants to merge 6 commits into
SarutobiSasuke8 wants to merge 6 commits into
Conversation
Introduces the dated blog-post data source that will back the new front page, kept separate from articles.js: posts are dated and read in reverse-chronological order, articles are evergreen methodology. Collapsing the two would leave the listing page with no coherent sort order. - prompt-library/posts.js — schema + 5 seed posts, hand-editable in the same style as prompts.js. Reuses the existing body-block vocabulary so posts and articles can share one renderer. - scripts/validate-posts.js — zero-dependency schema check mirroring validate-prompts.js. Also enforces slug format, real calendar dates, a single featured post, and known block types. - deploy.yml — runs the new validator alongside the prompts one. Verified: validator passes on the seed data and fails with the expected 4 errors when bad slug/date/duplicate-featured/unknown-block faults are injected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
article.html carried the only body-block renderer and its own copy of
the long-form reading styles. post.html needs both, so rather than
duplicate them they move to shared files.
- blocks.js — window.PL_BLOCKS.{render, wireCopyButtons, escapeHtml},
lifted from article.html with behaviour unchanged. The reference
block's link text is now overridable via linkLabel, defaulting to
the previous wording so existing articles render identically.
- style.css — absorbs the long-form styles that were inline in
article.html (193 lines), plus post-date/post-updated rules. Class
names unchanged, so article markup is untouched.
- article.html — now delegates to PL_BLOCKS; local renderBody and
copyToClipboard removed.
- post.html — detail page for posts. Accepts ?id= or ?slug=, renders
newer/older nav in reverse-chronological order, mounts ratings and
comments under the "post" type, and emits BlogPosting JSON-LD.
Verified in Chromium over http: post.html renders by id and by slug,
falls back to "Post not found" for a bad or missing id, orders
newer/older correctly at both ends of the range, and article.html
renders unchanged after the refactor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
Frees index.html for the blog front page. The library page itself is unchanged apart from its filename. - git mv index.html library.html (rename preserved in history) - 22 link references across 9 pages repointed to library.html - nav.js — library entry now targets library.html; a new "blog" entry leads the nav at index.html. The logo href stays index.html, which is still the site home. - footer.js — gains a blog link ahead of library - mds.js — two references in contribution-checklist doc text - supabase.js — two comments claimed it loads from index.html; only user.html has ever loaded it, so they now say user.html Note: the index.html?cat= and index.html#prompt-N links from agents/collections/user were already inert — nothing reads ?cat= or the hash. They are moved verbatim rather than silently repaired. Verified: no unintended index.html references remain (the six left are the nav logo, nav/footer blog links, and post.html back-links), and library.html renders all 58 prompts with correct nav and footer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
The blog is now the site's front door. Posts render newest-first with
a featured slot, live search, and tag chips generated from the data —
adding a tag in posts.js creates its filter chip with no UI change,
mirroring how the library derives category chips from CATEGORIES.
- index.html — hero, featured post, post feed, tag/search controls,
and an "explore the library" section linking to prompts, md repo,
tools, agents, collections, articles, playground, and about, so the
rest of the site is reachable from the front page rather than the
nav alone.
- style.css — blog front page styles (featured card, post cards,
explore tiles) built from the existing tokens.
- ?tag= deep links are honoured, so tag pills on a post filter the
front page. An unknown tag falls back to "all" rather than an
empty feed.
Deviation from plan: the explore tiles carry descriptions, not live
counts. Live counts would mean loading prompts.js, mds.js, tools.js
and articles.js on the front page — about 400KB for six numbers, on a
mobile-first site.
Also fixes a pre-existing site-wide bug found while testing at 375px:
nav.js set display:flex inline on the desktop nav, which outranked
the `.site-header nav { display: none }` rule and leaked the full nav
onto mobile. Every page overflowed horizontally as a result
(learn.html 806px at a 375px viewport). Removing the inline display
lets the stylesheet control it; the front page drops from 765px to
421px.
Residual, pre-existing and NOT fixed here: the header's count pill,
theme toggle, avatar chip and burger still overflow 375px on every
page (library 472px, post 500px). Fixing it means deciding what the
header drops on mobile — a product call, left for review.
Verified in Chromium: search, tag filter, empty state, featured
hide-on-filter, ?tag= deep links including an unknown tag, and
click-through to post.html. Nav hides at 375px and shows at 900px.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
Completes the post type across the shared surfaces so it behaves like every other item rather than a special case. - bookmarks.js — adds the `post` bucket to the store shape and the load path. Existing saved data is unaffected: absent keys already default to []. - user.html — new "saved posts" section in the Bookmarks panel, between saved prompts and saved articles, ordered newest-first. Loads posts.js. - ratings.js — doc comment lists `post` among valid types. - sitemap.xml — adds library.html, the five posts, and mdrepo.html (which had never been listed); / and index.html now point at the blog. Verified: bookmarking a post from post.html writes post:[id] to the store and survives reload; toggling removes it; the card builder and selection logic produce correct hrefs, UTC-stable dates, tags, and newest-first order. Not verifiable in this environment: the profile Bookmarks panel does not render items for ANY type here, including articles on unmodified main — the panel depends on profile/auth state that needs network. Confirmed pre-existing by running the same probe against main's user.html and bookmarks.js. The saved-posts section is wired identically to saved-articles, so it should render wherever that one does, but it needs a signed-in check before release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
- prompt-library/CLAUDE.md — six-type taxonomy with the reasoning for adding `post` recorded (the previous "locked at five types" wording is replaced rather than quietly contradicted); file layout, nav order, data-active keys, posts.js schema, an "adding a post" procedure, split testing checklists, and a known-issues note. - CONTRIBUTING.md — post schema, validator step, and the post-vs-article distinction. - README.md — post type, page table, local-open instructions. - CLAUDE.md (root) — blog-first orientation, and a note that the branch name's "maine" is a typo for "main" with no geographic meaning, so a future reader doesn't infer a localisation requirement. - sessions/ — full session report plus an index row. The session report records three pre-existing defects found while testing that were confirmed against main and deliberately not fixed here: the 375px header overflow, a TDZ error in collections.html, and a syntax error in md.html. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014v3DG3X8pkVxjsg9rSEMyY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes an AI blog the site's front page, with every other surface still reachable from it. The prompt library moves to
library.htmlunchanged.Note on the branch name: "maine" is a typo for "main". There is no geographic or localisation content in this PR, and none was intended.
What changed
index.html= prompt libraryindex.html= blog feedlibrary.html= prompt library (unchanged content)post.html= post detail pageNew
posts.js— dated blog content. Deliberately separate fromarticles.js: posts sort newest-first, articles are evergreen with no meaningful publish date. Sharing one type would leave the listing page with no coherent order. Ships with 5 seed posts written to the repo's existing tone bar.post.html— accepts?id=or?slug=, newer/older nav, bookmark, ratings, comments,BlogPostingJSON-LD.blocks.js— body-block renderer extracted fromarticle.htmlso posts and articles render through one code path instead of two. Behaviour unchanged; thereferenceblock's link label stays "view on Amazon" by default for backwards compatibility and is now overridable vialinkLabel.scripts/validate-posts.js— zero-dependency schema check mirroringvalidate-prompts.js, wired into CI. Enforces unique ids/slugs, slug format, real calendar dates, a single featured post, and known block types.Changed
git mv index.html library.htmlplus 22 link references across 9 pages,nav.js,footer.js,mds.js, andsupabase.js.blogentry leading the nav. The logo still points atindex.html, which is still home.postitem type — added tobookmarks.jsand a saved-posts section onuser.html.article.htmlintostyle.cssso both detail pages share them.Decisions worth reviewing
The item taxonomy is no longer five types.
prompt-library/CLAUDE.mddescribed it as locked. Rather than quietly violate that, the doc now records whypostwas added and reframes the constraint as costly-and-justifiable rather than impossible — a locked list invites the worse failure of mislabelling a new kind of thing as an existing one.Explore tiles carry descriptions, not live counts. This deviates from the plan. Live counts would mean loading
prompts.js,mds.js,tools.jsandarticles.json the front page — roughly 400KB for six numbers, on a mobile-first site.Inert links moved verbatim.
index.html?cat=agentsandindex.html#prompt-Nlinks were already no-ops (nothing reads?cat=or the hash). They're repointed tolibrary.htmlwithout being silently repaired.Testing
Chromium via Playwright, served over HTTP:
?tag=deep links including an unknown tag falling back to "all", click-through to posts?id=and?slug=; bad/missing id shows "Post not found"; newer/older correct at both ends; bookmark toggles and survives reloadblocks.jsrefactorfeatured, and an unknown block type — all four caughtBug fixed along the way
nav.jssetdisplay:flexinline on the desktop nav, which outranked the.site-header nav { display: none }rule and leaked the full nav onto mobile. Every page overflowed horizontally as a result (learn.htmlwas 806px wide at a 375px viewport). Removing the inlinedisplaylets the stylesheet control it — the front page drops from 765px to 421px.Known issues — pre-existing, NOT fixed here
All three were confirmed against
mainbefore being classified as pre-existing:collections.html—Cannot access 'BM_OUTLINE' before initialization(TDZ error).md.html—Unexpected stringsyntax error.Not verified
The saved-posts section on
user.htmlhas not been seen rendering. The profile Bookmarks panel renders nothing for any type in a sandbox without network/auth — reproduced identically againstmain'suser.html, so it isn't caused by this PR. The selection and card-building logic was verified correct in isolation and the section is wired identically to saved-articles, but it wants one signed-in check before release.Deploy impact
Merging triggers the Pages workflow. Anything linking to
/expecting the prompt grid will land on the blog instead. There's no hash routing, so the blast radius is small, but worth knowing.An RSS feed was deliberately deferred — it's the one feature that genuinely wants a generation step, which conflicts with the no-build constraint.
Generated by Claude Code