Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<!-- ASTRYX:START -->

Astryx v0.5.2 · 163 components
Astryx v0.6.0 · 163 components
CLI: run every command as `npx astryx <cmd>` (shown below as `astryx ...`).

SETUP (once, in your app entry e.g. main.tsx) — without these, components render unstyled:
Expand All @@ -66,8 +66,8 @@ MORE CLI:
search "<query>" find any component / hook / doc / template / block
component --list 163 components by category
template --list page + block recipes
docs <topic> browser-support, cli-integrations, color, elevation, getting-started, icons, illustrations, internationalization, layout, migration, motion, principles, shape, spacing, styling-libraries, styling, theme, tokens, typography, working-with-ai
docs <topic> browser-support, cli-integrations, color, elevation, getting-started, icons, illustrations, internationalization, layout, migration, motion, principles, shadcn-compatibility, shape, spacing, styling-libraries, styling, theme, tokens, typography, working-with-ai
swizzle <Name> eject component source for deep customization
upgrade --apply run after any @astryxdesign/core bump
upgrade --apply run after any Astryx or integration dependency bump

<!-- ASTRYX:END -->
92 changes: 64 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"@astrojs/markdoc": "2.0.6",
"@astrojs/react": "6.0.2",
"@astrojs/sitemap": "3.7.3",
"@astryxdesign/core": "0.5.2",
"@astryxdesign/theme-chocolate": "0.5.2",
"@astryxdesign/theme-matcha": "0.5.2",
"@astryxdesign/theme-neutral": "0.5.2",
"@astryxdesign/theme-stone": "0.5.2",
"@astryxdesign/core": "0.6.0",
"@astryxdesign/theme-chocolate": "0.6.0",
"@astryxdesign/theme-matcha": "0.6.0",
"@astryxdesign/theme-neutral": "0.6.0",
"@astryxdesign/theme-stone": "0.6.0",
"@keystar/ui": "0.9.2",
"@keystatic/astro": "5.2.0",
"@keystatic/core": "0.6.4",
Expand All @@ -39,7 +39,7 @@
},
"devDependencies": {
"@astrojs/check": "0.9.6",
"@astryxdesign/cli": "0.5.2",
"@astryxdesign/cli": "0.6.0",
"@types/node": "24.10.0",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
Expand Down
45 changes: 45 additions & 0 deletions src/components/BlogDirectory.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, it } from 'vitest';
import { BlogDirectory } from './BlogDirectory';
import { getBlogTags, tagHref } from '../lib/blog-directory';

const posts = [
{
href: '/blog/test/',
title: 'Test article',
summary: '<unsafe>',
publishedAt: '2026-06-01',
formattedDate: 'June 1, 2026',
tags: ['First', ' Second ', 'Second'],
},
];

describe('blog directory rendering', () => {
it('server-renders posts with dates and every tag link, escaping content', () => {
const html = renderToStaticMarkup(
<BlogDirectory posts={posts} tags={getBlogTags(posts)} />,
);
expect(html).toContain('href="/blog/test/"');
expect(html).toContain('dateTime="2026-06-01"');
expect(html).toContain('&lt;unsafe&gt;');
expect(html).toContain(`href="${tagHref('Second')}"`);
expect(html).toContain('aria-current="true"');
expect(html).not.toContain('First tag');
});
it('provides empty-state copy without requiring content', () => {
const html = renderToStaticMarkup(<BlogDirectory posts={[]} tags={[]} />);
expect(html).toContain('Writing will appear here when published.');
expect(html).toContain('No tags yet.');
});
it('marks the active tag and offers a way back to Blog', () => {
const html = renderToStaticMarkup(
<BlogDirectory
posts={posts}
tags={getBlogTags(posts)}
activeTag="Second"
/>,
);
expect(html).toContain('aria-current="page"');
expect(html).toContain('Back to all blog posts');
});
});
Loading