Skip to content

post: beginning again + adopt YAML frontmatter for posts#52

Merged
viniciusdc merged 3 commits into
mainfrom
post/beginning-again
May 19, 2026
Merged

post: beginning again + adopt YAML frontmatter for posts#52
viniciusdc merged 3 commits into
mainfrom
post/beginning-again

Conversation

@viniciusdc

@viniciusdc viniciusdc commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Two changes, coupled because the post can't ship without the API change.

YAML frontmatter for posts

Posts no longer wrap themselves in `<ArticleLayout ...>`. The layout is referenced from frontmatter and the body is pure markdown:

---
layout: '@/layouts/ArticleLayout.astro'
title: Beginning again
date: 2026-05-18
tag: meta
description: Notes on starting a notebook...
---

I've started a blog several times. ...

Cleaner, less JSX in things that should read like prose. MDX is still allowed — imports work normally for future use (custom components, math, etc.).

The post itself

A meta opener in your voice — frames writing as a thinking tool, sets out the broader scope (software / AI/math/design/games), declares an honest commitment to publishing imperfect things.

Test plan

  • `pixi run npm run build` produces 8 pages including `/writing/beginning-again/`.
  • `pixi run npm run spell` is green.
  • Rendered HTML shows `

    2026-05-18 · meta

    ` — date coercion works.
  • Headings, paragraphs, and italics all render through the layout's serif-essay styles.
  • CI green.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new writing entry (“Beginning again”) to validate the new writing layout and ensure the /writing index renders correctly with real MDX prose content.

Changes:

  • Introduces a new MDX post under /writing/beginning-again/ with metadata consumed by the /writing index.
  • Uses ArticleLayout with title/meta/subtitle/back link to exercise the new typography and TOC behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pages/writing/beginning-again/index.mdx
Comment thread src/pages/writing/beginning-again/index.mdx
@viniciusdc viniciusdc force-pushed the post/beginning-again branch from 2919cc6 to 5c61944 Compare May 19, 2026 19:39
A meta post kicking off the new notebook era. Honest about prior
attempts stalling, frames writing as a thinking tool rather than an
audience-facing thing, sets out what the notebook will and won't try
to be.

Tagged "meta" — content-about-the-notebook rather than any of the
existing topical tags.
Posts no longer need to wrap themselves in <ArticleLayout ...>. The
layout is referenced from yaml frontmatter and the body is pure
markdown. Cleaner, less boilerplate, less JSX in things that should
read like prose.

Example post header — what authors write now:

  ---
  layout: '@/layouts/ArticleLayout.astro'
  title: Beginning again
  date: 2026-05-18
  tag: meta
  description: ...
  ---

  I've started a blog several times. ...

Changes:

- ArticleLayout reads from `Astro.props.frontmatter` when used as a
  layout reference, falls back to direct props when used inline from
  an .astro file (backward-compat for project pages). Auto-composes
  `meta` as "date · tag" so authors don't have to compute it.
- YAML dates are auto-parsed into Date objects, which broke string
  sorts and rendered as ISO timestamps. Coerced to YYYY-MM-DD via
  a duck-typed asDateString helper in the layout, the writing index,
  and the homepage.
- Listing pages (homepage, /writing/) now accept both `frontmatter`
  (yaml-front-matter pattern) and `metadata` (export const pattern).
- Templates (note.mdx, architecture.mdx, project.mdx) updated to the
  yaml-frontmatter shape. project.mdx uses `frontmatter.X` to read
  fields inside the body for the ProjectMeta block.
- Beginning-again post rewritten in the new format — header is yaml,
  body is markdown, no JSX wrapping.
- cspell: add "frontmatter".

Project pages in `src/pages/projects/<slug>/index.astro` keep their
existing pattern (export const metadata + ArticleLayout wrapper) —
ArticleLayout still supports it via direct props.
@viniciusdc viniciusdc force-pushed the post/beginning-again branch from 5c61944 to 17aa97c Compare May 19, 2026 19:40
@viniciusdc viniciusdc changed the title post: beginning again post: beginning again + adopt YAML frontmatter for posts May 19, 2026
The \`layout: '@/layouts/ArticleLayout.astro'\` line was boilerplate on
every post. Made it optional via a small remark plugin in
astro.config.mjs that injects the layout into the frontmatter for any
mdx file under /pages/writing/ or /pages/projects/ that doesn't already
have one.

Authors can still override per-post by setting \`layout:\` explicitly.

While here:
- Layout's \`meta\` composition now falls back to \`fm.label\` so project
  pages auto-render their label above the title without needing an
  explicit \`meta:\` line.
- Drop the \`layout:\` line from note / architecture / project templates
  and the beginning-again post.
- Drop the \`meta: system\` redundancy from the project template.
@viniciusdc viniciusdc merged commit 804ad87 into main May 19, 2026
6 checks passed
@viniciusdc viniciusdc deleted the post/beginning-again branch May 19, 2026 19:50
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