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
20 changes: 20 additions & 0 deletions packages/ono/example/barrels/blog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Auto-generated barrel file - DO NOT EDIT
// Generated by Ono SSG

export type Meta = {
title: string;
date: string;
author: string;
tags?: string[];
};

export { default as gettingStarted, meta as gettingStartedMeta } from './blog/getting-started.tsx';
export { default as helloWorld, meta as helloWorldMeta } from './blog/hello-world.tsx';

export const entries = ['getting-started', 'hello-world'] as const;
export type EntryId = typeof entries[number];

export const posts = {
'getting-started': { component: gettingStarted, meta: gettingStartedMeta },
'hello-world': { component: helloWorld, meta: helloWorldMeta }
};
24 changes: 24 additions & 0 deletions packages/ono/example/barrels/blog/getting-started.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const meta = {
title: "Getting Started with Ono",
date: "2025-01-03",
author: "hashrock",
tags: ["tutorial", "ono"],
};

export default function GettingStarted() {
return (
<article>
<h1>{meta.title}</h1>
<p class="text-gray-500">{meta.date} by {meta.author}</p>
<div class="flex gap-2 mb-4">
{meta.tags.map((tag) => (
<span class="px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm">{tag}</span>
))}
</div>
<h2>Installation</h2>
<pre><code>npm install @hashrock/ono</code></pre>
<h2>Usage</h2>
<p>Create a pages directory and add JSX files.</p>
</article>
);
}
16 changes: 16 additions & 0 deletions packages/ono/example/barrels/blog/hello-world.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const meta = {
title: "Hello World",
date: "2025-01-04",
author: "hashrock",
};

export default function HelloWorld() {
return (
<article>
<h1>{meta.title}</h1>
<p class="text-gray-500">{meta.date} by {meta.author}</p>
<p>Welcome to my first blog post built with Ono SSG!</p>
<p>This is a simple example of using barrels for content management.</p>
</article>
);
}
11 changes: 0 additions & 11 deletions packages/ono/example/content.config.js

This file was deleted.

37 changes: 0 additions & 37 deletions packages/ono/example/content/blog/first-post.md

This file was deleted.

33 changes: 0 additions & 33 deletions packages/ono/example/content/blog/second-post.md

This file was deleted.

69 changes: 0 additions & 69 deletions packages/ono/example/pages/blog.jsx

This file was deleted.

81 changes: 0 additions & 81 deletions packages/ono/example/pages/blog/[slug].jsx

This file was deleted.

3 changes: 1 addition & 2 deletions packages/ono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"./renderer": "./src/renderer.js",
"./transformer": "./src/transformer.js",
"./bundler": "./src/bundler.js",
"./content": "./src/content.js",
"./barrels": "./src/barrels.js",
"./browser/compiler": "./src/browser/compiler.js",
"./browser/unocss": "./src/browser/unocss.js"
},
Expand Down Expand Up @@ -54,7 +54,6 @@
"dependencies": {
"@unocss/preset-uno": "^66.5.4",
"h3": "^2.0.1-rc.5",
"marked": "^16.4.1",
"typescript": "^5.9.3",
"unocss": "^66.5.4",
"ws": "^8.18.3"
Expand Down
Loading