Compare commits

..

No commits in common. "feature-pages" and "main" have entirely different histories.

9 changed files with 7 additions and 58 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -3,7 +3,6 @@ title = "davesmithhayes.com"
[owner]
name = "Dave Smith-Hayes"
email = "me@davesmithhayes.com"
mastadonUrl = "https://hachyderm.io/@davesh"
[site]
description = "Personal website of Dave Smith-Hayes - a father, developer, and musician."

View File

@ -1,4 +1,4 @@
header, footer, nav, main {
header, footer, main {
max-width: 800px;
margin: 0 auto;
padding: 1em;
@ -20,21 +20,6 @@ header .home-link a:visited {
color: #00e;
}
nav {
border-bottom: 1px solid #ccc;
}
nav ul {
margin: 0;
padding: 0;
}
nav ul li {
display: inline-block;
margin-left: 1em;
}
nav ul li:first-child {
margin-left: 0;
}
footer {
border-top: 1px solid #ccc;
}

View File

@ -3,7 +3,6 @@ import { Home } from "@blog/templates/Pages/Home";
import { PostMeta } from "@blog/models/PostMeta";
import { Post } from '@blog/models/Post';
import { PostService } from '@blog/services/post-file';
import { getSiteConfig } from '@blog/services/config';
type Posts = {
postService: PostService
@ -12,7 +11,6 @@ type Posts = {
const app = new Hono<{ Variables: Posts }>();
app.get("/", async (c) => {
const config = await getSiteConfig();
const postService: PostService = c.get('postService');
const isDev: boolean = process.env.DEPLOY_MODE == 'development';
@ -24,8 +22,8 @@ app.get("/", async (c) => {
return c.render(<Home posts={postList} />, {
meta: {
description: config.site.description,
mastodonUrl: config.owner.mastodonUrl,
description: "The blog for Dave Smith-Hayes, a dad and developer.",
mastodonUrl: "https://hachyderm.io/@davesh"
},
});
});

View File

@ -6,7 +6,6 @@ export type SiteConfig = {
owner: {
name: string;
email: string;
mastodonUrl?: string;
};
site: {
description: string;
@ -14,7 +13,7 @@ export type SiteConfig = {
repo: string;
language: string;
copyright: string;
};
}
}
export async function getSiteConfig(): Promise<SiteConfig> {

View File

@ -22,13 +22,11 @@ export async function getFeed(postService: PostService): Feed {
}
});
const fullSlug = (slug) => config.site.url + "/posts/" + slug;
postService.getPublishedPosts().map((post: Post) => {
feed.addItem({
title: post.meta.title,
id: fullSlug(post.meta.slug),
link: fullSlug(post.meta.slug),
id: post.meta.slug,
link: post.meta.slug,
description: post.meta.description,
content: post.html,
author: {

View File

@ -1,7 +1,6 @@
import { Style } from 'hono/css';
import { SiteMeta } from '@blog/models/SiteMeta';
import { MetaTags } from '@blog/templates/components/MetaTags';
import { Navigation } from '@blog/templates/components/Navigation';
function getPageTitle(title: string|undefined): string {
if (!title) {
@ -26,9 +25,6 @@ export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
<a href="/">davesmithhayes.com</a>
</div>
</header>
<nav>
<Navigation />
</nav>
<main>
{children}
</main>

View File

@ -4,6 +4,7 @@ import { PostMeta } from '@blog/models/PostMeta';
export function Home({ posts }: { posts: PostMeta[] }) {
return (
<div class="main">
<h1>Posts</h1>
{posts.length ? <PostList posts={posts} /> : <div>No posts.</div>}
</div>
);

View File

@ -1,27 +0,0 @@
type SitemapUrl = {
name: string;
path: string;
};
export function Navigation() {
const navigation: SitemapUrl[] = [
{
name: "Home",
path: "/",
},
{
name: "About",
path: "/about"
},
{
name: "RSS",
path: "/feed/rss.xml"
}
];
return (
<ul>
{navigation.map(n => <li><a href={n.path}>{n.name}</a></li>)}
</ul>
);
}