refactor: move blog from EmDash to Astro content collections

EmDash CMS integration is being removed. The blog content is
moved to native Astro content collections (markdown files in
src/content/blog/) which works with the static output config.

Changes:
- Remove EmDash from astro.config.mjs (revert to static output)
- Remove emdash packages from package.json/package-lock.json
- Remove seed/seed.json (was EmDash-only)
- Remove src/live.config.ts (EmDash Astro loader)
- Add src/content.config.ts (Astro content collection for blog)
- Move 3 blog posts to src/content/blog/*.md
- Update src/pages/index.astro to use getCollection('blog')
- Update src/pages/บทความ/[slug].astro to use render() from astro:content
  (Astro 6 API: render(article), not article.render())
- Update src/pages/บทความ/index.astro (blog list)
- Add .hermes/ to .gitignore

Verified:
- npm run build: 35 pages, complete in 2.50s
- / , /aeroflex, /about-us, /บทความ, /บทความ/welcome-post: all 200
This commit is contained in:
Kunthawat Greethong
2026-06-03 14:02:41 +07:00
parent c8cf03a725
commit ef4b0f2e89
13 changed files with 296 additions and 4800 deletions

View File

@@ -1,10 +1,6 @@
import { defineConfig } from 'astro/config'
import tailwindcss from '@tailwindcss/vite'
import node from '@astrojs/node'
import react from '@astrojs/react'
import emdash, { local } from 'emdash/astro'
import { sqlite } from 'emdash/db'
import { google } from 'emdash/auth/providers/google'
import { fileURLToPath } from 'url'
import path from 'path'
@@ -12,10 +8,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
site: 'https://dealplustech.com',
output: 'server',
adapter: node({
mode: 'standalone',
}),
output: 'static',
vite: {
plugins: [tailwindcss()],
resolve: {
@@ -29,14 +22,6 @@ export default defineConfig({
},
integrations: [
react(),
emdash({
database: sqlite({ url: 'file:./data.db' }),
storage: local({
directory: './uploads',
baseUrl: '/_emdash/api/media/file',
}),
authProviders: [google()],
}),
],
build: {
assets: '_assets',