commit 67c6e47f588129af21a510aa598917513f5dbd56 Author: z0x Date: Wed Jan 8 22:06:02 2025 -0500 feat(all): first init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16d54bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..3a1c9ec --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d642209 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..70ab3ae --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "conventionalCommits.scopes": ["workflow", "index", "package"] +} diff --git a/astro.config.ts b/astro.config.ts new file mode 100644 index 0000000..cf6b5d1 --- /dev/null +++ b/astro.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from "astro/config"; +import tailwind from "@astrojs/tailwind"; +import remarkCallout from "@r4ai/remark-callout"; +import sitemap from "@astrojs/sitemap"; + +export default defineConfig({ + site: "https://blog.z0x.ca", + integrations: [ + tailwind({ + nesting: true, + }), + sitemap(), + ], + markdown: { + shikiConfig: { + theme: "css-variables", + }, + remarkPlugins: [ + remarkCallout, + ], + } +}); \ No newline at end of file diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..7b3e7de Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..30273d7 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "blog.z0x.ca", + "type": "module", + "version": "1.0.0", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro check && astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/check": "^0.9.4", + "@astrojs/rss": "^4.0.11", + "@astrojs/sitemap": "^3.2.1", + "@astrojs/tailwind": "^5.1.4", + "@fontsource/geist-mono": "^5.1.1", + "@fontsource/geist-sans": "^5.1.0", + "@r4ai/remark-callout": "^0.6.2", + "astro": "^5.1.3", + "clsx": "^2.1.1", + "tailwind-merge": "^2.6.0", + "tailwindcss": "^3.4.17", + "typescript": "^5.7.3" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.16" + } +} diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..63d5f6d --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,55 @@ + + + + diff --git a/src/components/ArrowCard.astro b/src/components/ArrowCard.astro new file mode 100644 index 0000000..9574dc9 --- /dev/null +++ b/src/components/ArrowCard.astro @@ -0,0 +1,26 @@ +--- +import type { CollectionEntry } from "astro:content"; + +type Props = { + entry: CollectionEntry<"blog">; +}; + +const { entry } = Astro.props as { + entry: CollectionEntry<"blog">; +}; +--- + + +
+
+ {entry.data.title} +
+
+ {entry.data.description} +
+
+ + + + +
diff --git a/src/components/BackToTop.astro b/src/components/BackToTop.astro new file mode 100644 index 0000000..829f124 --- /dev/null +++ b/src/components/BackToTop.astro @@ -0,0 +1,27 @@ +--- + +--- + + diff --git a/src/components/Callout.astro b/src/components/Callout.astro new file mode 100644 index 0000000..6e47b7a --- /dev/null +++ b/src/components/Callout.astro @@ -0,0 +1,44 @@ +--- +interface Props { + type: "default" | "info" | "warning" | "error"; +} + +const { type = "default" } = Astro.props; + +let emoji = "💡"; + +if (type === "info") { + emoji = "ℹ️"; +} else if (type === "warning") { + emoji = "⚠️"; +} else if (type === "error") { + emoji = "🚨"; +} +--- + +
+ {emoji} + +
+ + diff --git a/src/components/Container.astro b/src/components/Container.astro new file mode 100644 index 0000000..0a07cb4 --- /dev/null +++ b/src/components/Container.astro @@ -0,0 +1,5 @@ +--- + +--- + +
diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..239f038 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,52 @@ +--- +import Container from "@components/Container.astro"; +import BackToTop from "@components/BackToTop.astro"; +import { SITE } from "@consts"; +--- + + diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro new file mode 100644 index 0000000..ee266ae --- /dev/null +++ b/src/components/FormattedDate.astro @@ -0,0 +1,17 @@ +--- +interface Props { + date: Date; +} + +const { date } = Astro.props; +--- + + diff --git a/src/components/Head.astro b/src/components/Head.astro new file mode 100644 index 0000000..8796e5c --- /dev/null +++ b/src/components/Head.astro @@ -0,0 +1,251 @@ +--- +import "../styles/global.css"; +import "../styles/callout.css"; + +import { ClientRouter } from "astro:transitions"; + +import "@fontsource/geist-sans/100.css"; +import "@fontsource/geist-sans/200.css"; +import "@fontsource/geist-sans/300.css"; +import "@fontsource/geist-sans/400.css"; +import "@fontsource/geist-sans/500.css"; +import "@fontsource/geist-sans/600.css"; +import "@fontsource/geist-sans/700.css"; +import "@fontsource/geist-sans/800.css"; +import "@fontsource/geist-sans/900.css"; +import "@fontsource/geist-mono/100.css"; +import "@fontsource/geist-mono/200.css"; +import "@fontsource/geist-mono/300.css"; +import "@fontsource/geist-mono/400.css"; +import "@fontsource/geist-mono/500.css"; +import "@fontsource/geist-mono/600.css"; +import "@fontsource/geist-mono/700.css"; +import "@fontsource/geist-mono/800.css"; +import "@fontsource/geist-mono/900.css"; + +interface Props { + title: string; + description: string; + image?: string; +} + +const { title, description, image = "/blog-placeholder-1.jpg" } = Astro.props; +--- + + + + + + + +{title} + + + + + + + + + + + + + + + + + + diff --git a/src/components/Link.astro b/src/components/Link.astro new file mode 100644 index 0000000..d4ed5e8 --- /dev/null +++ b/src/components/Link.astro @@ -0,0 +1,31 @@ +--- +import { cn } from "@lib/utils"; + +type Props = { + href: string; + external?: boolean; + underline?: boolean; + group?: boolean; +}; + +const { + href, + external, + underline = true, + group = false, + ...rest +} = Astro.props; +--- + + + + diff --git a/src/components/PostNavigation.astro b/src/components/PostNavigation.astro new file mode 100644 index 0000000..f557f7c --- /dev/null +++ b/src/components/PostNavigation.astro @@ -0,0 +1,33 @@ +--- +const { prevPost, nextPost } = Astro.props; +--- + +
+ { + prevPost?.id ? ( + + + + + +
{prevPost?.data.title}
+
+ ) : ( +