Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blog): building a blog environment using honox #11

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions blog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
dist
.wrangler
.dev.vars
.hono

# Change them to your taste:
wrangler.toml
package-lock.json
yarn.lock
pnpm-lock.yaml
bun.lockb
12 changes: 12 additions & 0 deletions blog/app/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createClient } from 'honox/client';

createClient({
hydrate: async (elem, root) => {
const { hydrateRoot } = await import('react-dom/client');
hydrateRoot(root, elem);
},
createElement: async (type: any, props: any) => {
const { createElement } = await import('react');
return createElement(type, props);
},
});
13 changes: 13 additions & 0 deletions blog/app/constans/author.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Author = {
name: string;
about: string;
icon: string;
};

export const authors: { [key: string]: Author } = {
yossydev: {
name: 'yossydev',
about: 'web developer',
icon: '/static/author/yossydev.jpg',
},
} as const;
9 changes: 9 additions & 0 deletions blog/app/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {} from 'hono';

import '@hono/react-renderer';

declare module '@hono/react-renderer' {
interface Props {
title?: string;
}
}
Loading