Skip to content

Make the AI blog the front page; move the prompt library to library.html - #4

Open
SarutobiSasuke8 wants to merge 6 commits into
mainfrom
claude/maine-ai-blog-variant-02v4ej
Open

Make the AI blog the front page; move the prompt library to library.html#4
SarutobiSasuke8 wants to merge 6 commits into
mainfrom
claude/maine-ai-blog-variant-02v4ej

Conversation

@SarutobiSasuke8

Copy link
Copy Markdown
Owner

Makes an AI blog the site's front page, with every other surface still reachable from it. The prompt library moves to library.html unchanged.

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

Before After
index.html = prompt library index.html = blog feed
library.html = prompt library (unchanged content)
post.html = post detail page

New

  • posts.js — dated blog content. Deliberately separate from articles.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, BlogPosting JSON-LD.
  • blocks.js — body-block renderer extracted from article.html so posts and articles render through one code path instead of two. Behaviour unchanged; the reference block's link label stays "view on Amazon" by default for backwards compatibility and is now overridable via linkLabel.
  • scripts/validate-posts.js — zero-dependency schema check mirroring validate-prompts.js, wired into CI. Enforces unique ids/slugs, slug format, real calendar dates, a single featured post, and known block types.

Changed

  • Library movegit mv index.html library.html plus 22 link references across 9 pages, nav.js, footer.js, mds.js, and supabase.js.
  • Front page — featured post, reverse-chronological feed, live search, tag chips generated from the data, and an "explore the library" section linking to all seven other surfaces.
  • Nav — gains a blog entry leading the nav. The logo still points at index.html, which is still home.
  • post item type — added to bookmarks.js and a saved-posts section on user.html.
  • Styles — the long-form reading styles move out of article.html into style.css so both detail pages share them.

Decisions worth reviewing

The item taxonomy is no longer five types. prompt-library/CLAUDE.md described it as locked. Rather than quietly violate that, the doc now records why post was 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.js and articles.js on the front page — roughly 400KB for six numbers, on a mobile-first site.

Inert links moved verbatim. index.html?cat=agents and index.html#prompt-N links were already no-ops (nothing reads ?cat= or the hash). They're repointed to library.html without being silently repaired.

Testing

Chromium via Playwright, served over HTTP:

  • Blog — search, tag filter, empty state, featured hide-on-filter, ?tag= deep links including an unknown tag falling back to "all", click-through to posts
  • Post — renders by ?id= and ?slug=; bad/missing id shows "Post not found"; newer/older correct at both ends; bookmark toggles and survives reload
  • Article — verified unchanged after the blocks.js refactor
  • Library — all 58 prompts render with correct nav and footer after the move
  • Full-site link check across all 17 pages: all 31 distinct internal link targets exist
  • Validators pass; the posts validator was negative-tested by injecting a bad slug, an impossible date, a duplicate featured, and an unknown block type — all four caught

Bug fixed along the way

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 was 806px wide at a 375px viewport). Removing the inline display lets the stylesheet control it — the front page drops from 765px to 421px.

Known issues — pre-existing, NOT fixed here

All three were confirmed against main before being classified as pre-existing:

  1. Header still overflows 375px on every page (library 472px, post 500px). The count pill, theme toggle, avatar chip and burger don't fit beside the logo. Fixing it means deciding what the header drops on mobile — a product call, so it's left for you.
  2. collections.htmlCannot access 'BM_OUTLINE' before initialization (TDZ error).
  3. md.htmlUnexpected string syntax error.

Not verified

The saved-posts section on user.html has not been seen rendering. The profile Bookmarks panel renders nothing for any type in a sandbox without network/auth — reproduced identically against main's user.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

claude added 6 commits July 31, 2026 19:36
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
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.

2 participants