create-mdx-blog 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/bin/index.mjs +72 -0
- package/package.json +29 -4
- package/template/README.md +21 -0
- package/template/_gitignore +44 -0
- package/template/eslint.config.mjs +19 -0
- package/template/next.config.ts +34 -0
- package/template/package.json +36 -0
- package/template/pnpm-workspace.yaml +3 -0
- package/template/public/avatar.svg +5 -0
- package/template/src/app/(posts)/layout.tsx +27 -0
- package/template/src/app/(posts)/welcome-to-your-blog/page.md +51 -0
- package/template/src/app/globals.css +108 -0
- package/template/src/app/layout.tsx +120 -0
- package/template/src/app/opengraph-image.tsx +74 -0
- package/template/src/app/page.tsx +43 -0
- package/template/src/app/resume/page.md +47 -0
- package/template/src/app/robots.ts +12 -0
- package/template/src/app/rss.xml/route.ts +51 -0
- package/template/src/app/sitemap.ts +30 -0
- package/template/src/blog.config.ts +101 -0
- package/template/src/components/CodeBlock.tsx +45 -0
- package/template/src/components/Footer.tsx +40 -0
- package/template/src/components/Header.tsx +32 -0
- package/template/src/components/LazyMermaid.tsx +20 -0
- package/template/src/components/Mermaid.tsx +184 -0
- package/template/src/components/PostHeader.tsx +35 -0
- package/template/src/components/PrintButton.tsx +15 -0
- package/template/src/components/ResumeHeader.tsx +51 -0
- package/template/src/lib/constants.ts +13 -0
- package/template/src/lib/posts.ts +122 -0
- package/template/src/mdx-components.tsx +152 -0
- package/template/tsconfig.json +42 -0
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Minimalist Next.js + MDX Blog (`create-mdx-blog`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffold a fast, minimalist personal blog and interactive resume built with **Next.js 16 (App Router)**, **MDX (`@next/mdx`)**, **Tailwind CSS v4**, **Shiki syntax highlighting**, and **Mermaid** diagrams—configured from a single `src/blog.config.ts` file.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Create a new blog using your favorite package manager:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npx
|
|
11
|
+
npx create-mdx-blog my-blog
|
|
12
|
+
|
|
13
|
+
# pnpm
|
|
14
|
+
pnpm create mdx-blog my-blog
|
|
15
|
+
|
|
16
|
+
# npm
|
|
17
|
+
npm create mdx-blog@latest my-blog
|
|
18
|
+
|
|
19
|
+
# yarn
|
|
20
|
+
yarn create mdx-blog my-blog
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then install dependencies and start the dev server:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd my-blog
|
|
27
|
+
pnpm install
|
|
28
|
+
pnpm dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Customizing Your Blog
|
|
32
|
+
|
|
33
|
+
Edit `src/blog.config.ts` to change:
|
|
34
|
+
- **Site & Author info**: Name, tagline, domain URL, avatar image, and resume contact details
|
|
35
|
+
- **Theme colors**: `background`, `foreground`, `accent`, `accentHover`, and `surface`
|
|
36
|
+
- **Social & Footer links**: Resume, LinkedIn, GitHub, Instagram, or any custom links
|
|
37
|
+
|
|
38
|
+
## Writing Posts & Editing Your Resume
|
|
39
|
+
|
|
40
|
+
- **Blog posts**: Add a folder under `src/app/(posts)/<slug>/page.md` (or `page.mdx`).
|
|
41
|
+
- **Resume**: Edit `src/app/resume/page.md` (includes built-in print/PDF styling).
|
package/bin/index.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const rawTarget = process.argv[2] || "my-mdx-blog";
|
|
11
|
+
const targetDir = path.resolve(process.cwd(), rawTarget);
|
|
12
|
+
const projectName = path.basename(targetDir);
|
|
13
|
+
const templateDir = path.resolve(__dirname, "..", "template");
|
|
14
|
+
|
|
15
|
+
if (!fs.existsSync(templateDir)) {
|
|
16
|
+
console.error(
|
|
17
|
+
"Error: Template directory not found. Run `node scripts/build-template.mjs` first."
|
|
18
|
+
);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (fs.existsSync(targetDir) && fs.readdirSync(targetDir).length > 0) {
|
|
23
|
+
console.error(
|
|
24
|
+
`Error: Target directory "${rawTarget}" already exists and is not empty.`
|
|
25
|
+
);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function copyRecursive(src, dest) {
|
|
30
|
+
const stat = fs.statSync(src);
|
|
31
|
+
if (stat.isDirectory()) {
|
|
32
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
33
|
+
for (const entry of fs.readdirSync(src)) {
|
|
34
|
+
const nextDestName = entry === "_gitignore" ? ".gitignore" : entry;
|
|
35
|
+
copyRecursive(path.join(src, entry), path.join(dest, nextDestName));
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
39
|
+
fs.copyFileSync(src, dest);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log(`\nScaffolding your new MDX blog in ${targetDir}...\n`);
|
|
44
|
+
copyRecursive(templateDir, targetDir);
|
|
45
|
+
|
|
46
|
+
const pkgJsonPath = path.join(targetDir, "package.json");
|
|
47
|
+
if (fs.existsSync(pkgJsonPath)) {
|
|
48
|
+
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
|
|
49
|
+
pkg.name = projectName
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.replace(/[^a-z0-9-_]/g, "-")
|
|
52
|
+
.replace(/^-+|-+$/g, "");
|
|
53
|
+
fs.writeFileSync(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function detectPackageManager() {
|
|
57
|
+
const ua = process.env.npm_config_user_agent || "";
|
|
58
|
+
if (ua.startsWith("pnpm")) return "pnpm";
|
|
59
|
+
if (ua.startsWith("yarn")) return "yarn";
|
|
60
|
+
if (ua.startsWith("bun")) return "bun";
|
|
61
|
+
return "npm";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const pm = detectPackageManager();
|
|
65
|
+
const runCmd = pm === "npm" ? "npm run" : pm;
|
|
66
|
+
|
|
67
|
+
console.log("Done! Your blog is ready.\n");
|
|
68
|
+
console.log("Next steps:");
|
|
69
|
+
console.log(` 1. cd ${rawTarget}`);
|
|
70
|
+
console.log(` 2. ${pm} install`);
|
|
71
|
+
console.log(" 3. Customize your site colors, name & links in src/blog.config.ts");
|
|
72
|
+
console.log(` 4. ${runCmd} dev\n`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mdx-blog",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Scaffold a minimalist Next.js + MDX personal blog and resume website driven by a single config file.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-mdx-blog": "./bin/index.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"template",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build:template": "node ./scripts/build-template.mjs",
|
|
16
|
+
"prepack": "node ./scripts/build-template.mjs"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"nextjs",
|
|
20
|
+
"mdx",
|
|
21
|
+
"blog",
|
|
22
|
+
"portfolio",
|
|
23
|
+
"resume",
|
|
24
|
+
"tailwindcss",
|
|
25
|
+
"mermaid"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# My Personal MDX Blog
|
|
2
|
+
|
|
3
|
+
Built with [create-mdx-blog](https://www.npmjs.com/package/create-mdx-blog) using **Next.js 16**, **MDX**, **Tailwind CSS v4**, **Shiki**, and **Mermaid**.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
13
|
+
|
|
14
|
+
## Customizing Your Blog (`src/blog.config.ts`)
|
|
15
|
+
|
|
16
|
+
All site text, author info, social links, and theme colors live in `src/blog.config.ts`:
|
|
17
|
+
|
|
18
|
+
- **Colors**: Change `theme.background`, `theme.foreground`, `theme.accent`, `theme.accentHover`, and `theme.surface`.
|
|
19
|
+
- **Author & Avatar**: Replace `public/avatar.svg` (or add `public/profile.jpg`) and update `author` in `src/blog.config.ts`.
|
|
20
|
+
- **Resume**: Update `src/app/resume/page.md` with your experience and skills.
|
|
21
|
+
- **New Posts**: Create `src/app/(posts)/<your-slug>/page.md` with `export const metadata = { title, date, description }`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
|
|
36
|
+
# vercel
|
|
37
|
+
.vercel
|
|
38
|
+
|
|
39
|
+
# typescript
|
|
40
|
+
*.tsbuildinfo
|
|
41
|
+
next-env.d.ts
|
|
42
|
+
|
|
43
|
+
# cli generated template
|
|
44
|
+
/packages/create-mdx-blog/template
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
|
|
5
|
+
const eslintConfig = defineConfig([
|
|
6
|
+
...nextVitals,
|
|
7
|
+
...nextTs,
|
|
8
|
+
// Override default ignores of eslint-config-next.
|
|
9
|
+
globalIgnores([
|
|
10
|
+
// Default ignores of eslint-config-next:
|
|
11
|
+
".next/**",
|
|
12
|
+
"out/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"next-env.d.ts",
|
|
15
|
+
"packages/**",
|
|
16
|
+
]),
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
export default eslintConfig;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import createMDX from "@next/mdx";
|
|
2
|
+
import type { NextConfig } from "next";
|
|
3
|
+
|
|
4
|
+
const nextConfig: NextConfig = {
|
|
5
|
+
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
|
|
6
|
+
cacheComponents: true,
|
|
7
|
+
partialPrefetching: true,
|
|
8
|
+
turbopack: {
|
|
9
|
+
rules: {
|
|
10
|
+
"*.css": {
|
|
11
|
+
loaders: ["@tailwindcss/turbopack"],
|
|
12
|
+
as: "*.css",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const withMDX = createMDX({
|
|
19
|
+
extension: /\.(md|mdx)$/,
|
|
20
|
+
options: {
|
|
21
|
+
format: "mdx",
|
|
22
|
+
rehypePlugins: [
|
|
23
|
+
[
|
|
24
|
+
"rehype-pretty-code",
|
|
25
|
+
{
|
|
26
|
+
theme: "one-dark-pro",
|
|
27
|
+
keepBackground: false,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export default withMDX(nextConfig);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blog",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "eslint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@mdx-js/loader": "^3.1.1",
|
|
13
|
+
"@mdx-js/react": "^3.1.1",
|
|
14
|
+
"@next/mdx": "^16.4.6",
|
|
15
|
+
"@types/mdx": "^2.0.14",
|
|
16
|
+
"@vercel/analytics": "^2.0.1",
|
|
17
|
+
"@vercel/speed-insights": "^2.1.0",
|
|
18
|
+
"mermaid": "^12.3.0",
|
|
19
|
+
"next": "16.4.6",
|
|
20
|
+
"react": "19.3.0",
|
|
21
|
+
"react-dom": "19.3.0",
|
|
22
|
+
"rehype-pretty-code": "^0.14.6",
|
|
23
|
+
"shiki": "^4.6.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@tailwindcss/turbopack": "4.3.3",
|
|
27
|
+
"@types/node": "^20",
|
|
28
|
+
"@types/react": "^19",
|
|
29
|
+
"@types/react-dom": "^19",
|
|
30
|
+
"eslint": "^9",
|
|
31
|
+
"eslint-config-next": "16.4.6",
|
|
32
|
+
"tailwindcss": "4.3.3",
|
|
33
|
+
"typescript": "^5"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "pnpm@12.21.0"
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { blogConfig } from "@/blog.config";
|
|
3
|
+
import { PostHeader } from "@/components/PostHeader";
|
|
4
|
+
import { getAllPosts } from "@/lib/posts";
|
|
5
|
+
|
|
6
|
+
export default async function PostLayout({
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) {
|
|
11
|
+
const posts = await getAllPosts();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<article className="pb-16">
|
|
15
|
+
<PostHeader posts={posts} />
|
|
16
|
+
<div>{children}</div>
|
|
17
|
+
<footer className="mt-14 border-t border-white/10 pt-6">
|
|
18
|
+
<Link
|
|
19
|
+
href="/"
|
|
20
|
+
className="text-sm font-medium text-accent transition-colors hover:text-accent-hover"
|
|
21
|
+
>
|
|
22
|
+
{blogConfig.labels.backToPosts}
|
|
23
|
+
</Link>
|
|
24
|
+
</footer>
|
|
25
|
+
</article>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const metadata = {
|
|
2
|
+
title: "Welcome to Your New MDX Blog",
|
|
3
|
+
date: "2026-11-21",
|
|
4
|
+
description:
|
|
5
|
+
"How to customize your theme colors, author profile, and write Markdown posts with code highlighting and Mermaid diagrams.",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
Welcome to your new personal blog! Everything on this site—your name, theme colors, social links, and resume header—is controlled from a single configuration file at `src/blog.config.ts`.
|
|
9
|
+
|
|
10
|
+
## 1. Customizing Your Site
|
|
11
|
+
|
|
12
|
+
Open `src/blog.config.ts` to update your name, bio, social links, and color palette:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
export const blogConfig = {
|
|
16
|
+
site: {
|
|
17
|
+
name: "Your Name",
|
|
18
|
+
title: "Your Name",
|
|
19
|
+
url: "https://your-domain.com",
|
|
20
|
+
},
|
|
21
|
+
theme: {
|
|
22
|
+
background: "rgb(40, 44, 53)",
|
|
23
|
+
foreground: "#ffffff",
|
|
24
|
+
accent: "#bc8a01",
|
|
25
|
+
accentHover: "#d9a212",
|
|
26
|
+
surface: "#1d2027",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<div data-node-type="callout">
|
|
32
|
+
<div data-node-type="callout-emoji">💡</div>
|
|
33
|
+
<div data-node-type="callout-text">
|
|
34
|
+
<strong><em>Tip: </em></strong>
|
|
35
|
+
<em>Replace <code>public/avatar.svg</code> with your own photo and update <code>author.avatar</code> in <code>src/blog.config.ts</code>.</em>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
## 2. Writing Blog Posts
|
|
40
|
+
|
|
41
|
+
Create a new folder under `src/app/(posts)/<your-slug>/page.md` (or `page.mdx`). The post title, date, and estimated reading time are rendered automatically from `export const metadata`.
|
|
42
|
+
|
|
43
|
+
## 3. Mermaid Diagrams
|
|
44
|
+
|
|
45
|
+
Fenced `mermaid` code blocks render automatically with a full-screen lightbox view:
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart LR
|
|
49
|
+
A[Edit blog.config.ts] --> B[Write Markdown Post]
|
|
50
|
+
B --> C[Deploy to Vercel]
|
|
51
|
+
```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--background: rgb(40, 44, 53);
|
|
5
|
+
--foreground: #ffffff;
|
|
6
|
+
--accent: #bc8a01;
|
|
7
|
+
--accent-hover: #d9a212;
|
|
8
|
+
--surface: #1d2027;
|
|
9
|
+
--muted: rgba(255, 255, 255, 0.65);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@theme inline {
|
|
13
|
+
--color-background: var(--background);
|
|
14
|
+
--color-foreground: var(--foreground);
|
|
15
|
+
--color-accent: var(--accent);
|
|
16
|
+
--color-accent-hover: var(--accent-hover);
|
|
17
|
+
--color-surface: var(--surface);
|
|
18
|
+
--color-muted: var(--muted);
|
|
19
|
+
--font-sans: var(--font-montserrat), "Montserrat Fallback", system-ui, sans-serif;
|
|
20
|
+
--font-serif: var(--font-merriweather), "Merriweather Fallback", Georgia, serif;
|
|
21
|
+
--font-mono: var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@layer base {
|
|
25
|
+
html,
|
|
26
|
+
body {
|
|
27
|
+
background-color: var(--background);
|
|
28
|
+
color: var(--foreground);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
font-family: var(--font-merriweather), "Merriweather Fallback", Georgia, serif;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h1,
|
|
36
|
+
h2,
|
|
37
|
+
h3,
|
|
38
|
+
h4,
|
|
39
|
+
h5,
|
|
40
|
+
h6 {
|
|
41
|
+
font-family: var(--font-montserrat), "Montserrat Fallback", system-ui, sans-serif;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-node-type="callout"] {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
gap: 0.75rem;
|
|
49
|
+
margin: 1.5rem 0;
|
|
50
|
+
padding: 1rem 1.25rem;
|
|
51
|
+
border-radius: 0.5rem;
|
|
52
|
+
border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
|
|
53
|
+
background-color: color-mix(in srgb, var(--surface) 75%, transparent);
|
|
54
|
+
color: rgba(255, 255, 255, 0.9);
|
|
55
|
+
line-height: 1.75;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-node-type="callout-emoji"] {
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
font-size: 1.25rem;
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media print {
|
|
65
|
+
html,
|
|
66
|
+
body {
|
|
67
|
+
background: #ffffff !important;
|
|
68
|
+
color: #111111 !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
header,
|
|
72
|
+
footer {
|
|
73
|
+
display: none !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
body *,
|
|
77
|
+
.resume-page * {
|
|
78
|
+
color: #111111 !important;
|
|
79
|
+
border-color: #d4d4d4 !important;
|
|
80
|
+
text-decoration-color: #111111 !important;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.resume-page h2 {
|
|
85
|
+
color: var(--accent);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.resume-page a {
|
|
89
|
+
color: var(--accent);
|
|
90
|
+
text-decoration: underline;
|
|
91
|
+
text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
|
|
92
|
+
text-underline-offset: 4px;
|
|
93
|
+
transition: color 150ms ease;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.resume-page a:hover {
|
|
97
|
+
color: var(--accent-hover);
|
|
98
|
+
text-decoration-color: var(--accent-hover);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-rehype-pretty-code-figure] {
|
|
102
|
+
margin: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-rehype-pretty-code-figure] [data-line] {
|
|
106
|
+
display: inline-block;
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Analytics } from "@vercel/analytics/next";
|
|
2
|
+
import { SpeedInsights } from "@vercel/speed-insights/next";
|
|
3
|
+
import type { Metadata } from "next";
|
|
4
|
+
import { Geist_Mono, Merriweather, Montserrat } from "next/font/google";
|
|
5
|
+
import type { CSSProperties } from "react";
|
|
6
|
+
import { blogConfig } from "@/blog.config";
|
|
7
|
+
import { Footer } from "@/components/Footer";
|
|
8
|
+
import { Header } from "@/components/Header";
|
|
9
|
+
import "./globals.css";
|
|
10
|
+
|
|
11
|
+
const montserrat = Montserrat({
|
|
12
|
+
variable: "--font-montserrat",
|
|
13
|
+
subsets: ["latin"],
|
|
14
|
+
weight: ["400", "500", "600", "700", "800", "900"],
|
|
15
|
+
display: "swap",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const merriweather = Merriweather({
|
|
19
|
+
variable: "--font-merriweather",
|
|
20
|
+
subsets: ["latin"],
|
|
21
|
+
weight: ["400", "700"],
|
|
22
|
+
style: ["normal", "italic"],
|
|
23
|
+
display: "swap",
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const geistMono = Geist_Mono({
|
|
27
|
+
variable: "--font-geist-mono",
|
|
28
|
+
subsets: ["latin"],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const metadata: Metadata = {
|
|
32
|
+
metadataBase: new URL(blogConfig.site.url),
|
|
33
|
+
title: {
|
|
34
|
+
default: blogConfig.site.title,
|
|
35
|
+
template: `%s — ${blogConfig.site.title}`,
|
|
36
|
+
},
|
|
37
|
+
description: blogConfig.site.description,
|
|
38
|
+
authors: [{ name: blogConfig.author.name, url: blogConfig.site.url }],
|
|
39
|
+
creator: blogConfig.author.name,
|
|
40
|
+
openGraph: {
|
|
41
|
+
type: "website",
|
|
42
|
+
locale: "en_US",
|
|
43
|
+
url: blogConfig.site.url,
|
|
44
|
+
siteName: blogConfig.site.title,
|
|
45
|
+
title: blogConfig.site.title,
|
|
46
|
+
description: blogConfig.site.description,
|
|
47
|
+
},
|
|
48
|
+
twitter: {
|
|
49
|
+
card: "summary_large_image",
|
|
50
|
+
title: blogConfig.site.title,
|
|
51
|
+
description: blogConfig.site.description,
|
|
52
|
+
},
|
|
53
|
+
alternates: {
|
|
54
|
+
canonical: "/",
|
|
55
|
+
types: {
|
|
56
|
+
"application/rss+xml": `${blogConfig.site.url}/rss.xml`,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
robots: {
|
|
60
|
+
index: true,
|
|
61
|
+
follow: true,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const sameAsLinks = [
|
|
66
|
+
blogConfig.social.linkedin,
|
|
67
|
+
blogConfig.social.github,
|
|
68
|
+
blogConfig.social.instagram,
|
|
69
|
+
].filter((url): url is string => Boolean(url));
|
|
70
|
+
|
|
71
|
+
const jsonLd = {
|
|
72
|
+
"@context": "https://schema.org",
|
|
73
|
+
"@graph": [
|
|
74
|
+
{
|
|
75
|
+
"@type": "Person",
|
|
76
|
+
name: blogConfig.author.name,
|
|
77
|
+
url: blogConfig.site.url,
|
|
78
|
+
jobTitle: blogConfig.author.jobTitle,
|
|
79
|
+
sameAs: sameAsLinks,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"@type": "WebSite",
|
|
83
|
+
name: blogConfig.site.title,
|
|
84
|
+
url: blogConfig.site.url,
|
|
85
|
+
description: blogConfig.site.description,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const themeStyle = {
|
|
91
|
+
"--background": blogConfig.theme.background,
|
|
92
|
+
"--foreground": blogConfig.theme.foreground,
|
|
93
|
+
"--accent": blogConfig.theme.accent,
|
|
94
|
+
"--accent-hover": blogConfig.theme.accentHover,
|
|
95
|
+
"--surface": blogConfig.theme.surface,
|
|
96
|
+
} as CSSProperties;
|
|
97
|
+
|
|
98
|
+
export default function RootLayout({ children }: LayoutProps<"/">) {
|
|
99
|
+
return (
|
|
100
|
+
<html
|
|
101
|
+
lang="en"
|
|
102
|
+
style={themeStyle}
|
|
103
|
+
className={`${montserrat.variable} ${merriweather.variable} ${geistMono.variable} h-full antialiased`}
|
|
104
|
+
>
|
|
105
|
+
<body className="min-h-full bg-background text-foreground flex flex-col">
|
|
106
|
+
<script
|
|
107
|
+
type="application/ld+json"
|
|
108
|
+
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
|
109
|
+
/>
|
|
110
|
+
<div className="mx-auto flex w-full max-w-2xl flex-1 flex-col px-6 pt-12 pb-16">
|
|
111
|
+
<Header />
|
|
112
|
+
<main className="flex-1">{children}</main>
|
|
113
|
+
</div>
|
|
114
|
+
<Footer />
|
|
115
|
+
<Analytics />
|
|
116
|
+
<SpeedInsights />
|
|
117
|
+
</body>
|
|
118
|
+
</html>
|
|
119
|
+
);
|
|
120
|
+
}
|