refactor(website): simplify landing page (helpers, types, data-driven blocks) by Jocs · Pull Request #4350 · marktext/marktext · GitHub
Skip to content

refactor(website): simplify landing page (helpers, types, data-driven blocks) - #4350

Merged
Jocs merged 1 commit into
developfrom
simplify/website-landing
Jun 2, 2026
Merged

Jocs merged 1 commit into
developfrom
simplify/website-landing

Conversation

@Jocs

@Jocs Jocs commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Internal cleanups to the landing page (app/page.tsx + components/*.tsx). The rendered page is the same — same layout, same copy, same animations, same Tailwind/CSS output. Smaller diffs going forward.

  • lib/sections.ts: SECTIONS now stores plain ids (no leading #); add hash(id), revealClass(delay?, extra?), the RevealDelay union and a DEFAULT_THEME constant. Consumers stop calling .slice(1) to recover the id, and stop building "reveal d1" by hand.
  • lib/links.ts: a shared EXT_LINK = { target: '_blank', rel: 'noopener noreferrer' } as const that replaces 12+ hand-written triples across Nav / Footer / Hero / Download / Support.
  • Brand component: factor the logo + wordmark block out of Nav and Footer (the two copies were verbatim).
  • FeatureCard: drop the style / titleStyle / descStyle / className escape hatches. Expose delay?: RevealDelay + variant?: 'lg' instead. FocusExport switches to the variant + new mini--lg / platforms--start / plat--compact CSS modifier classes, removing several inline-style triplets.
  • Stats / Download: render from a STATS[] / PLATFORMS[] data table instead of repeated JSX blocks.
  • Themes: the duplicate SunSmallIcon is dropped from Icons.tsx; Themes.tsx uses SunIcon instead.
  • useTheme + app/layout.tsx: read DEFAULT_THEME from sections.ts so the inline boot script no longer hard-codes the 'dark' literal in three places.
  • globals.css: add the new modifier classes (.card--lg, .plat--compact, .platforms--start, .block--top-tight, .kicker--center, .hero-cta--center, .hero-note--cta, .grid-3.grid-2, .mini--lg) that replace inline style triplets.

Test plan

  • pnpm --filter marktext-website type-check
  • pnpm --filter marktext-website lint
  • pnpm --filter marktext-website build (37 static pages)
  • CI

🤖 Generated with Claude Code

… blocks)

- sections.ts: SECTIONS now stores plain ids; add hash() + revealClass()
  helpers, RevealDelay union, and DEFAULT_THEME so consumers stop
  calling .slice(1) and stop concatenating "reveal d1" by hand.
- lib/links.ts: shared EXT_LINK constant replaces the 12+ hand-written
  target="_blank" rel="noopener noreferrer" triples on the landing page.
- Brand component: factor the logo + wordmark block out of Nav and Footer
  (it was a verbatim copy).
- FeatureCard: drop the style / titleStyle / descStyle / className escape
  hatches; expose delay? + variant?: 'lg' instead. FocusExport switches
  to the variant + new mini--lg / platforms--start / plat--compact CSS
  modifier classes.
- Stats / Download: render from a STATS[] / PLATFORMS[] data table
  instead of repeated JSX blocks.
- Themes: replace the duplicate SunSmallIcon with SunIcon (removed from
  Icons.tsx).
- useTheme + app/layout: read DEFAULT_THEME from sections.ts so the
  inline boot script no longer hard-codes the 'dark' literal.
- globals.css: add the modifier classes (.card--lg, .plat--compact,
  .platforms--start, .block--top-tight, .kicker--center,
  .hero-cta--center, .hero-note--cta, .grid-3.grid-2, .mini--lg) that
  replace the previous inline style triplets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Build artifacts for PR #4350:

Run: https://github.com/marktext/marktext/actions/runs/26832302713

Artifact Size Link
marktext-windows-arm64 270.6 MB Download
marktext-linux 592.9 MB Download
marktext-macos-x64 271.7 MB Download
marktext-windows-x64 271.9 MB Download
marktext-macos-arm64 261.4 MB Download

@Jocs
Jocs merged commit 1c7058a into develop Jun 2, 2026
11 checks passed
@Jocs
Jocs deleted the simplify/website-landing branch June 10, 2026 07:08
thimbleberrysystems pushed a commit to thimbleberrysystems/WordBird that referenced this pull request Jun 21, 2026
… blocks) (marktext#4350)

- sections.ts: SECTIONS now stores plain ids; add hash() + revealClass()
  helpers, RevealDelay union, and DEFAULT_THEME so consumers stop
  calling .slice(1) and stop concatenating "reveal d1" by hand.
- lib/links.ts: shared EXT_LINK constant replaces the 12+ hand-written
  target="_blank" rel="noopener noreferrer" triples on the landing page.
- Brand component: factor the logo + wordmark block out of Nav and Footer
  (it was a verbatim copy).
- FeatureCard: drop the style / titleStyle / descStyle / className escape
  hatches; expose delay? + variant?: 'lg' instead. FocusExport switches
  to the variant + new mini--lg / platforms--start / plat--compact CSS
  modifier classes.
- Stats / Download: render from a STATS[] / PLATFORMS[] data table
  instead of repeated JSX blocks.
- Themes: replace the duplicate SunSmallIcon with SunIcon (removed from
  Icons.tsx).
- useTheme + app/layout: read DEFAULT_THEME from sections.ts so the
  inline boot script no longer hard-codes the 'dark' literal.
- globals.css: add the modifier classes (.card--lg, .plat--compact,
  .platforms--start, .block--top-tight, .kicker--center,
  .hero-cta--center, .hero-note--cta, .grid-3.grid-2, .mini--lg) that
  replace the previous inline style triplets.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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