Skip to content

Give /playground its own heading and prerendered copy - #1

Merged
PytechNo merged 2 commits into
mainfrom
search-playground-heading-copy
Oct 16, 2026
Merged

PytechNo merged 2 commits into
mainfrom
search-playground-heading-copy

Conversation

@PytechNo

@PytechNo PytechNo commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Two of the search ranking tasks from todo.md (section 9).

/playground

  • The page's H1 is now "Online Luau & Lua Editor", matching its <title>. It sits in the header where the "Playground" pill was; "Weblua" in the logo is now a plain span.
  • A 146-word "Online Luau compiler and Lua interpreter" section replaces the one-line footer. It targets the queries with impressions and no clicks ("luau online compiler", "luau editor", "online luau compiler", "luau online editor") and links to the homepage FAQ.
  • The header and that section live in a new PlaygroundShell component:
    • scripts/postbuild.mjs prerenders it into dist/playground/index.html, so crawlers that don't run JS see the heading and copy. The postbuild now fails if either prerendered page lacks an <h1>.
    • App's Suspense fallback renders the same shell, so nothing flickers while the editor chunk loads.

About text as a dismissible card (64394e0)

  • On desktop the about section is a card floating over the bottom of the output pane, with a close button. It takes no layout, so header and workspace fill the first screen and the editor keeps its full height. Before this, the section sat below the first screen, so scrolling over the editor pulled the page down to it.
  • Closing it sets weblua:about-dismissed in localStorage. index.html's pre-paint script (the one that applies the theme) hides the card on later visits before it can flash.
  • Crawlers keep no storage between loads, so they always get the text, as does every first-time visitor.
  • On phones the section stays in flow under the panes, below the first screen; only the close button is new there. /embed still has no about text.

Homepage headings

  • "Three steps. Zero setup." → "How to run Luau online"
  • "Questions, answered" → "Luau & Lua playground FAQ" (the eyebrow above it changes from "FAQ" to "Questions" to avoid repeating it)

Verification

  • npm run build passes (tsc -b, vite build, postbuild). dist/playground/index.html contains the H1, the about text, the close button, and the pre-paint check.
  • npm test: 26 files, 456 tests pass.
  • In the dev server:
    • 1280×800: the page is exactly one screen and the panes are 594px tall. The card sits inside the output pane.
    • A real click on the close button hides the card and sets the key. It stays hidden after a reload, with its text still in the DOM.
    • 375px wide: the section is in flow below the first screen, with no horizontal scroll.
    • /embed renders no card.
  • Not checked: dark theme by eye, and a real full-size screen (the browser pane was too small for useful screenshots).

🤖 Generated with Claude Code

PytechNo and others added 2 commits October 16, 2026 12:48
The playground page gets an H1 matching its title, "Online Luau & Lua Editor", in the header where the "Playground" pill was, and a 146-word section below the first screen that targets the "luau online compiler" and "luau editor" queries and links to the homepage FAQ. The header and that section move into PlaygroundShell, which the postbuild prerenders into dist/playground/index.html so crawlers that don't run JS see them, and which App's Suspense fallback reuses so nothing shifts while the editor chunk loads.

The homepage's "Three steps. Zero setup." and "Questions, answered" headings become "How to run Luau online" and "Luau & Lua playground FAQ".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On desktop the "Online Luau compiler and Lua interpreter" section becomes a card floating over the bottom of the output pane, with a close button. It takes no layout, so header and workspace fill the first screen again and scrolling over the editor no longer pulls the page down to the text. Closing it sets weblua:about-dismissed in localStorage, and index.html's pre-paint script hides the card on later visits before it can flash. Crawlers keep no storage between loads, so they always get the text, as does every first-time visitor.

On phones the section stays in flow under the panes, below the first screen, as before; only the close button is new. The embed route still has no about text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PytechNo
PytechNo merged commit 8631082 into main Oct 16, 2026
1 check passed
@PytechNo
PytechNo deleted the search-playground-heading-copy branch October 16, 2026 18:09
PytechNo added a commit that referenced this pull request Oct 30, 2026
Searches for "luau playground" and "lua playground" have a ceiling: at
#1 for every playground query Weblua already appears for, it would get
about 1,700 clicks a month. /lua-formatter and /luau-type-checker
target other searches ("lua formatter online", "luau type checking",
"luau strict mode") where no online StyLua page or browser type
checker turned up.

Both are the playground with a tool route: getAppRoute maps the path to
a ToolPage, PlaygroundShell swaps in that tool's <h1> and about text,
and the workspace opens on the tool's demo (toolExamples, kept out of
the example picker). The formatter demo is unformatted Lua 5.4; the type
checker demo is strict Luau with one deliberate error, a string price.
Tool pages neither restore nor autosave the draft, and Start over leaves
it alone, so a quick format or check can't overwrite /playground's work.

The postbuild prerenders each page with its own title, description, and
canonical. The sitemap lists them, nginx folds their trailing-slash
variants, the homepage footer and the /playground about text link to
them, and they link to each other. Tests pin both demos: the formatter
one changes when formatted, and the checker one has exactly one error,
on the "80" line.

The todo gains section 11 with the remaining pages in order: Lua vs
Luau, a pattern tester, the "online lua compiler" queries, runnable
examples, 5.1 vs 5.4, table to JSON, a bytecode viewer, and Learn Luau,
plus the exploit searches to avoid.
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.

1 participant