diff --git a/.gitignore b/.gitignore
index 0140d5c..870d0bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
# dependencies
/node_modules
/.yarn
@@ -7,28 +5,14 @@
# testing
/coverage
-# next.js
-/.next/
-/out/
-
-# production
-/build
+# Solid Start
+/dist
+.solid
+.vinxi
+.output
+app.config.timestamp_*.js
# misc
.DS_Store
-*.pem
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
-# local env files
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-# build artifacts
-/public/atom.xml
-/public/json.json
+.netlify
diff --git a/.prettierignore b/.prettierignore
index 9bc5bbf..c75eecc 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,3 +1 @@
-# next.js
-/.next
/public
diff --git a/app.config.ts b/app.config.ts
new file mode 100644
index 0000000..ee202db
--- /dev/null
+++ b/app.config.ts
@@ -0,0 +1,16 @@
+import { defineConfig } from '@solidjs/start/config';
+
+// https://docs.solidjs.com/solid-start/reference/entrypoints/app-config
+
+export default defineConfig({
+ ssr: true,
+ // https://nitro.unjs.io/config
+ // https://vinxi.vercel.app/guide/getting-started.html
+ server: {
+ preset: 'static',
+ prerender: {
+ crawlLinks: true,
+ failOnError: true,
+ },
+ },
+});
diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx
deleted file mode 100644
index 54cb098..0000000
--- a/components/layout/layout.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import React from 'react';
-import Head from 'next/head';
-import { useRouter } from 'next/router';
-import Link from 'next/link';
-
-import styles from './layout.module.css';
-import { ThemePicker } from './theme-picker';
-import constants from '../../constants.json';
-
-const Meta: React.FC = () => (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
- {constants.title}
-
-
-
-
-
-
-
- >
-);
-
-const title = (
-
- Max Burson
-
-);
-
-export interface LayoutProps {
- mainProps?: React.HTMLProps;
-}
-
-export const Layout: React.FC = ({ children, mainProps }) => {
- const router = useRouter();
-
- return (
-
-
-
- {router.pathname === '/' ? {title}
: {title}
}
-
-
{children}
-
-
- );
-};
diff --git a/netlify.toml b/netlify.toml
index 96df76a..70a81a6 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,3 +1,3 @@
[build]
- command = "yarn build && yarn next export"
- publish = "out"
+ command = "yarn build"
+ publish = "./.output/public"
diff --git a/next-env.d.ts b/next-env.d.ts
deleted file mode 100644
index 4f11a03..0000000
--- a/next-env.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-///
-///
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/package.json b/package.json
index 82d8fb9..46e2ddd 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,6 @@
{
"name": "maxwell-bursons-blog",
+ "type": "module",
"description": "Blog of Maxwell Burson",
"version": "1.0.0",
"author": "Maxwell Burson ",
@@ -9,6 +10,7 @@
"engines": {
"node": "20"
},
+ "packageManager": "yarn@4.4.0",
"homepage": "https://maxburson.com",
"license": "MIT",
"main": "n/a",
@@ -17,10 +19,10 @@
"url": "git+https://github.com/maxburson/blog.git"
},
"scripts": {
- "dev": "next",
- "build": "yarn generateFeeds && next build",
+ "dev": "vinxi dev",
+ "build": "vinxi build",
+ "start": "vinxi start",
"format": "prettier --write --ignore-unknown .",
- "start": "next start",
"typecheck": "tsc",
"generateFeeds": "ts-node ./scripts/generate-feeds.ts"
},
@@ -33,29 +35,26 @@
"**/*": "prettier --write --ignore-unknown "
},
"dependencies": {
- "date-fns": "2.10.0",
- "gray-matter": "4.0.2",
- "next": "12",
- "normalize.css": "^8.0.1",
- "prismjs": "^1.25.0",
- "react": "^17.0.1",
- "react-dom": "^17.0.1",
- "remark": "^13.0.0",
- "remark-html": "^13.0.2",
- "typescript": "~4.5.0"
- },
- "devDependencies": {
+ "@solidjs/meta": "^0.29.4",
+ "@solidjs/router": "^0.14.1",
+ "@solidjs/start": "^1.0.6",
"@types/jest": "^25.2.2",
- "@types/node": "22",
- "@types/react": "^17.0.0",
- "@types/react-dom": "^17.0.0",
+ "@types/node": "20",
+ "date-fns": "2.10.0",
"feed": "^4.2.1",
"gatsby-remark-prismjs": "^3.10.0",
+ "gray-matter": "4.0.2",
"husky": "^4.3.6",
"lint-staged": "^10.5.3",
+ "normalize.css": "^8.0.1",
"prettier": "2.2.1",
+ "prismjs": "^1.25.0",
+ "remark": "^13.0.0",
+ "remark-html": "^13.0.2",
"sass": "^1.32.2",
- "ts-node": "^9.1.1"
- },
- "packageManager": "yarn@4.4.0"
+ "solid-js": "^1.8.18",
+ "ts-node": "^9.1.1",
+ "typescript": "~4.5.0",
+ "vinxi": "^0.4.1"
+ }
}
diff --git a/pages/404.tsx b/pages/404.tsx
deleted file mode 100644
index 1a4e411..0000000
--- a/pages/404.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Layout } from '../components/layout/layout';
-import styles from './404.module.css';
-
-const FileNotFound: React.FC = () => (
-
- 404: Not Found
-
-);
-
-export default FileNotFound;
diff --git a/pages/_app.tsx b/pages/_app.tsx
deleted file mode 100644
index f3077a6..0000000
--- a/pages/_app.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { AppProps } from 'next/app';
-
-import './global.scss';
-
-const App: React.FC = ({ Component, pageProps }: AppProps) => {
- return ;
-};
-
-export default App;
diff --git a/pages/_document.tsx b/pages/_document.tsx
deleted file mode 100644
index 29b6337..0000000
--- a/pages/_document.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Document, { Html, Head, Main, NextScript } from 'next/document';
-
-export default class MyDocument extends Document {
- render() {
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/pages/index.tsx b/pages/index.tsx
deleted file mode 100644
index 42a6f78..0000000
--- a/pages/index.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import Link from 'next/link';
-
-import { DateFormatter } from '../components/date-formatter';
-import { Layout } from '../components/layout/layout';
-import { getAllPosts } from '../lib/api';
-import { IPost } from '../types';
-
-import styles from './index.module.css';
-
-const author = 'Maxwell Burson';
-
-interface Props {
- posts: Omit[];
-}
-
-const Index: React.FC = ({ posts }) => (
-
-
-

-
- {author} writes about web development and TypeScript
-
-
-
- {posts.map((post) => (
-
-
-
- {post.date}
-
-
{post.excerpt}
-
- ))}
-
-);
-
-export default Index;
-
-export async function getStaticProps() {
- const posts = getAllPosts().map((p) => {
- const { content: _, ...rest } = p;
- return rest;
- });
-
- return { props: { posts } };
-}
diff --git a/pages/posts/[slug].tsx b/pages/posts/[slug].tsx
deleted file mode 100644
index 90f034b..0000000
--- a/pages/posts/[slug].tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-import Head from 'next/head';
-import Link from 'next/link';
-import { GetStaticPaths, GetStaticProps } from 'next';
-
-import constants from '../../constants.json';
-
-import { Layout } from '../../components/layout/layout';
-import { getPostBySlug, getAllPosts, getPostSlugs } from '../../lib/api';
-import { markdownToHtml } from '../../lib/markdownToHtml';
-import type { IPost } from '../../types';
-import { DateFormatter } from '../../components/date-formatter';
-
-import styles from './posts.module.scss';
-import 'prismjs/themes/prism-okaidia.css';
-
-interface Props {
- post: IPost;
- nextPost: null | Pick;
- lastPost: null | Pick;
-}
-
-const Post = ({ post, lastPost, nextPost }: Props) => (
-
-
-
-
-
- {`${constants.title} - ${post.title}`}
-
-
-
-
-
-
-
-
- {post.title}
-
-
-
-
-
-);
-
-export default Post;
-
-export const getStaticProps: GetStaticProps = async (
- context,
-) => {
- if (!context.params) {
- return { notFound: true };
- }
- const post = getPostBySlug(context.params.slug);
- const content = await markdownToHtml(post.content);
-
- const allPosts = getAllPosts();
- const index = allPosts.findIndex((p) => p.slug == post.slug);
- if (index === -1) {
- throw new Error();
- }
- const lastPost = allPosts[index - 1] ?? null;
- const nextPost = allPosts[index + 1] ?? null;
-
- return {
- props: {
- post: { ...post, content },
- lastPost: lastPost && { slug: lastPost.slug, title: lastPost.title },
- nextPost: nextPost && { slug: nextPost.slug, title: nextPost.title },
- },
- };
-};
-
-export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
- const posts = getPostSlugs();
-
- return {
- paths: posts.map((slug) => ({ params: { slug } })),
- fallback: false,
- };
-};
diff --git a/scripts/generate-feeds.ts b/scripts/generate-feeds.ts
index c877c46..1dec18e 100644
--- a/scripts/generate-feeds.ts
+++ b/scripts/generate-feeds.ts
@@ -2,8 +2,8 @@ import { Feed } from 'feed';
import fs from 'fs';
import constants from '../constants.json';
-import { getAllPosts } from '../lib/api';
-import { markdownToHtml } from '../lib/markdownToHtml';
+import { getAllPosts } from '../src/lib/api';
+import { markdownToHtml } from '../src/lib/markdown-to-html';
const url = process.env.__URL ?? constants.fallbackUrl;
diff --git a/pages/global.scss b/src/app.scss
similarity index 99%
rename from pages/global.scss
rename to src/app.scss
index 995f562..376ad66 100644
--- a/pages/global.scss
+++ b/src/app.scss
@@ -65,7 +65,7 @@ body {
height: 100%;
}
-#__next {
+#app {
display: contents;
}
diff --git a/src/app.tsx b/src/app.tsx
new file mode 100644
index 0000000..5d85d68
--- /dev/null
+++ b/src/app.tsx
@@ -0,0 +1,19 @@
+import { MetaProvider } from '@solidjs/meta';
+import { Router } from '@solidjs/router';
+import { FileRoutes } from '@solidjs/start/router';
+import { Suspense } from 'solid-js';
+import './app.scss';
+
+export default function App() {
+ return (
+ (
+
+ {props.children}
+
+ )}
+ >
+
+
+ );
+}
diff --git a/components/date-formatter.tsx b/src/components/date-formatter.tsx
similarity index 69%
rename from components/date-formatter.tsx
rename to src/components/date-formatter.tsx
index 6fee3fa..9084f00 100644
--- a/components/date-formatter.tsx
+++ b/src/components/date-formatter.tsx
@@ -5,10 +5,10 @@ export interface Props {
className?: string;
}
-export const DateFormatter: React.FC = ({ dateString, className }) => {
+export function DateFormatter({ dateString, className }: Props) {
const date = parseISO(dateString);
return (
-