|
| 1 | +--- |
| 2 | +title: 'MDX Playground — Test All Blog Features' |
| 3 | +excerpt: 'A single post to verify frontmatter, prose styling, code blocks, tables, lists, blockquotes, and links. Use this to confirm the full MDX blog pipeline works end-to-end.' |
| 4 | +coverImage: 'https://images.unsplash.com/photo-1517694712202-14dd9538aa97?w=800&auto=format&fit=crop' |
| 5 | +publishedAt: '2025-02-26' |
| 6 | +author: |
| 7 | + name: 'Boundless Dev' |
| 8 | + image: 'https://i.pravatar.cc/150?img=33' |
| 9 | +categories: ['Platform', 'Technology', 'Education'] |
| 10 | +tags: ['mdx', 'testing', 'playground', 'prose', 'markdown'] |
| 11 | +readingTime: 8 |
| 12 | +isFeatured: true |
| 13 | +--- |
| 14 | + |
| 15 | +# MDX Playground — Test All Blog Features |
| 16 | + |
| 17 | +This post exists so you can **test the entire blog stack**: frontmatter, static params, metadata, related posts, and every content pattern your MDX pipeline supports. |
| 18 | + |
| 19 | +## Frontmatter checklist |
| 20 | + |
| 21 | +- **Title & excerpt** — Used in listing, detail header, and meta tags. |
| 22 | +- **coverImage** — Rendered above the body; also in Open Graph / Twitter cards. |
| 23 | +- **publishedAt** — Shown in the byline and in `generateMetadata`. |
| 24 | +- **author.name & author.image** — Avatar and name in the header. |
| 25 | +- **categories & tags** — Tags under the post; both used for related posts. |
| 26 | +- **readingTime** — Available in frontmatter (use in UI if needed). |
| 27 | +- **isFeatured** — Listed in `getAllBlogPosts()`; filter on the blog index if desired. |
| 28 | + |
| 29 | +## Headings and text |
| 30 | + |
| 31 | +Use **bold** and _italic_ and `inline code` to confirm prose styling. Headings from `h1` to `h6` should get correct sizes from `prose` (this section is `h2`, below are `h3`). |
| 32 | + |
| 33 | +### Unordered list |
| 34 | + |
| 35 | +- First item |
| 36 | +- Second with **emphasis** |
| 37 | +- Third with [internal link](/blog) and [external link](https://stellar.org) |
| 38 | + |
| 39 | +### Ordered list |
| 40 | + |
| 41 | +1. Step one |
| 42 | +2. Step two |
| 43 | +3. Step three |
| 44 | + |
| 45 | +### Nested list |
| 46 | + |
| 47 | +- Parent |
| 48 | + - Child A |
| 49 | + - Child B |
| 50 | +- Another parent |
| 51 | + |
| 52 | +## Code blocks |
| 53 | + |
| 54 | +Inline code: `const x = 1`. |
| 55 | + |
| 56 | +Fenced block with language (syntax highlighting via prose): |
| 57 | + |
| 58 | +```typescript |
| 59 | +function greet(name: string): string { |
| 60 | + return `Hello, ${name}!`; |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +Rust snippet (e.g. Soroban): |
| 65 | + |
| 66 | +```rust |
| 67 | +pub fn release_milestone(env: Env, campaign_id: u64) -> Result<(), Error> { |
| 68 | + let campaign = env.storage().get::<Campaign>(&campaign_id)?; |
| 69 | + transfer_funds(&env, &campaign) |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +## Tables |
| 74 | + |
| 75 | +| Feature | Status | Notes | |
| 76 | +| ------------- | ------- | -------------- | |
| 77 | +| Frontmatter | Working | YAML parsed | |
| 78 | +| Prose | Working | Tailwind | |
| 79 | +| Code blocks | Working | Fenced | |
| 80 | +| Related posts | Working | Same tags/cats | |
| 81 | + |
| 82 | +## Blockquote |
| 83 | + |
| 84 | +> This is a blockquote. It should render with the prose blockquote styles and any custom styling you added. |
| 85 | +
|
| 86 | +## Links |
| 87 | + |
| 88 | +- [Blog index](/blog) |
| 89 | +- [Stellar](https://stellar.org) |
| 90 | +- [Trustless Work](https://trustlesswork.com) |
| 91 | + |
| 92 | +## Summary |
| 93 | + |
| 94 | +If this page loads at **`/blog/mdx-playground`**, and you see: |
| 95 | + |
| 96 | +1. Correct title, author, date, and cover image |
| 97 | +2. All headings, lists, code, table, and blockquote styled correctly |
| 98 | +3. Tags at the bottom |
| 99 | +4. Related articles in the sidebar/footer (other posts sharing tags/categories) |
| 100 | + |
| 101 | +then the MDX pipeline (content in `content/blog/`, `lib/mdx.ts`, and the blog pages) is working end to end. |
| 102 | + |
| 103 | +To use **custom MDX components** (e.g. `<Badge>`, `<Mermaid>`), add a `components` map to `compileMDX` in `lib/mdx.ts` and re-export those components; then you can use them in any `.mdx` file like `<Badge>Label</Badge>`. |
0 commit comments