From 18c4dbdb848298b5387a255146442bd2f516351e Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Tue, 28 Apr 2026 10:18:57 +0700 Subject: [PATCH] Simplified: remove Tailwind, standalone static HTML --- ...47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl | 2 + .omc/state/last-tool-error.json | 8 +- .omc/state/subagent-tracking.json | 2 +- Dockerfile | 16 +- astro.config.mjs | 15 -- nginx.conf | 14 -- package.json | 17 +- server.js | 6 +- src/components/Header.astro | 27 --- src/components/TrackingScripts.astro | 167 ------------------ src/content.config.ts | 2 +- src/layouts/Layout.astro | 63 ++++++- src/pages/index.astro | 63 +++---- src/styles/global.css | 57 ------ 14 files changed, 97 insertions(+), 362 deletions(-) delete mode 100644 nginx.conf delete mode 100644 src/components/Header.astro delete mode 100644 src/components/TrackingScripts.astro delete mode 100644 src/styles/global.css diff --git a/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl b/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl index b2ca400..9b63ae0 100644 --- a/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl +++ b/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl @@ -14,3 +14,5 @@ {"t":0,"agent":"a6bd471","agent_type":"unknown","event":"agent_stop","success":true} {"t":0,"agent":"aa941d3","agent_type":"unknown","event":"agent_stop","success":true} {"t":0,"agent":"a4954dc","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a405733","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a1c51b0","agent_type":"unknown","event":"agent_stop","success":true} diff --git a/.omc/state/last-tool-error.json b/.omc/state/last-tool-error.json index 32f1d86..642813d 100644 --- a/.omc/state/last-tool-error.json +++ b/.omc/state/last-tool-error.json @@ -1,7 +1,7 @@ { - "tool_name": "WebFetch", - "tool_input_preview": "{\"url\":\"https://docs.astro.build/en/guides/deploy/easypanel/\",\"prompt\":\"How to deploy Astro to Easypanel? What type of service should be used? What port or configuration is needed for Easypanel + Astr...", - "error": "timeout of 60000ms exceeded", - "timestamp": "2026-04-28T00:25:40.810Z", + "tool_name": "Bash", + "tool_input_preview": "{\"command\":\"docker ps -a --filter \\\"ancestor=astro-tina-test\\\" --format \\\"{{.ID}} {{.Status}}\\\" 2>/dev/null && echo \\\"---\\\" && docker images astro-tina-test --format \\\"{{.ID}} {{.Created}}\\\"\"}", + "error": "Exit code 1", + "timestamp": "2026-04-28T02:46:35.800Z", "retry_count": 1 } \ No newline at end of file diff --git a/.omc/state/subagent-tracking.json b/.omc/state/subagent-tracking.json index 30eaef3..b088c38 100644 --- a/.omc/state/subagent-tracking.json +++ b/.omc/state/subagent-tracking.json @@ -3,5 +3,5 @@ "total_spawned": 0, "total_completed": 0, "total_failed": 0, - "last_updated": "2026-04-28T00:28:25.963Z" + "last_updated": "2026-04-28T02:19:58.307Z" } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0a569da..e165912 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,14 @@ -FROM node:22-alpine AS builder +FROM node:22-alpine WORKDIR /app COPY package*.json ./ RUN npm install + COPY . . + RUN npm run build -FROM node:22-alpine AS runner - -WORKDIR /app - -ENV PORT=8080 -ENV DIST_DIR=./dist - -COPY --from=builder /app/dist ./dist -COPY --from=builder /app/server.js . - -EXPOSE 8080 +EXPOSE 4321 CMD ["node", "server.js"] \ No newline at end of file diff --git a/astro.config.mjs b/astro.config.mjs index 773b3ae..a293302 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,21 +6,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) export default defineConfig({ site: 'https://example.com', - integrations: [], - vite: { - define: { - 'import.meta.env.TINA_TOKEN': JSON.stringify(process.env.TINA_TOKEN || ''), - }, - resolve: { - alias: { - '@': path.resolve(__dirname, './src'), - '@components': path.resolve(__dirname, './src/components'), - '@layouts': path.resolve(__dirname, './src/layouts'), - '@styles': path.resolve(__dirname, './src/styles'), - '@content': path.resolve(__dirname, './src/content'), - }, - }, - }, output: 'static', build: { assets: '_assets', diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 0908018..0000000 --- a/nginx.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 80; - root /app/dist; - index index.html; - - location / { - try_files $uri $uri/ $uri.html =404; - } - - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { - expires 1y; - add_header Cache-Control "public, immutable"; - } -} diff --git a/package.json b/package.json index 9e2241f..94cacac 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,11 @@ "name": "astro-tina-sample", "type": "module", "version": "1.0.0", - "description": "Astro 6 + Tina CMS sample", + "description": "Astro 6 + Tina CMS sample for Easypanel", "scripts": { - "dev": "tinacms dev --port 3001 & astro dev", - "dev:astro": "astro dev", - "dev:tina": "tinacms dev --port 3001", + "dev": "astro dev --host 0.0.0.0", "build": "astro build", "preview": "astro preview", - "astro": "astro", "start": "node server.js" }, "dependencies": { @@ -18,18 +15,14 @@ "astro": "^6.1.7", "react": "^18.3.1", "react-dom": "^18.3.1", - "@tinacms/cli": "^2.2.3", "tinacms": "^2.2.3", "typescript": "^5.6.3" }, "devDependencies": { "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", - "tailwindcss": "^4.0.0", - "@tailwindcss/vite": "^4.2.4", - "@tailwindcss/typography": "^0.5.15" + "@types/react-dom": "^18.3.1" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } -} +} \ No newline at end of file diff --git a/server.js b/server.js index 4c87faf..406caf5 100644 --- a/server.js +++ b/server.js @@ -3,8 +3,8 @@ import { readFile } from 'node:fs/promises' import { join, extname } from 'node:path' import { existsSync } from 'node:fs' -const PORT = process.env.PORT || 8080 -const DIST_DIR = process.env.DIST_DIR || './dist' +const PORT = process.env.PORT || 4321 +const DIST_DIR = './dist' const mimeTypes = { '.html': 'text/html', @@ -63,12 +63,10 @@ const server = createServer(async (req, res) => { } } - // 404 res.writeHead(404) res.end('Not found') }) server.listen(PORT, '0.0.0.0', () => { console.log(`Server running at http://0.0.0.0:${PORT}`) - console.log(`Serving files from ${DIST_DIR}`) }) \ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro deleted file mode 100644 index 163a664..0000000 --- a/src/components/Header.astro +++ /dev/null @@ -1,27 +0,0 @@ ---- -interface Props { - siteName?: string -} - -const { siteName = "Astro Tina Starter" } = Astro.props ---- - -
- -
diff --git a/src/components/TrackingScripts.astro b/src/components/TrackingScripts.astro deleted file mode 100644 index 51d0abc..0000000 --- a/src/components/TrackingScripts.astro +++ /dev/null @@ -1,167 +0,0 @@ ---- -const ga4Id = import.meta.env.PUBLIC_GA4_ID -const gtmId = import.meta.env.PUBLIC_GTM_ID -const umamiUrl = import.meta.env.PUBLIC_UMAMI_URL -const umamiWebsiteId = import.meta.env.PUBLIC_UMAMI_WEBSITE_ID -const clarityId = import.meta.env.PUBLIC_CLARITY_ID -const fbPixelId = import.meta.env.PUBLIC_FB_PIXEL_ID -const googleAdsId = import.meta.env.PUBLIC_GOOGLE_ADS_ID -const tiktokPixelId = import.meta.env.PUBLIC_TIKTOK_PIXEL_ID -const lineChannelId = import.meta.env.PUBLIC_LINE_CHANNEL_ID ---- - - -{ga4Id && ( - -)} -{ga4Id && ( - -)} - - -{gtmId && ( - -)} - - -{umamiUrl && umamiWebsiteId && ( - -)} - - -{clarityId && ( - -)} - - -{fbPixelId && ( - -)} -{fbPixelId && ( - -)} - - -{googleAdsId && ( - -)} - - -{tiktokPixelId && ( - -)} - - -{lineChannelId && ( - -)} diff --git a/src/content.config.ts b/src/content.config.ts index 2ce15ab..29ee470 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -32,4 +32,4 @@ export const collections = { posts: postCollection, pages: pageCollection, settings: settingsCollection, -} +} \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 216bcfb..80d1172 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,7 +1,4 @@ --- -import "@/styles/global.css" -import TrackingScripts from "@/components/TrackingScripts.astro" - interface Props { title?: string description?: string @@ -25,13 +22,8 @@ const consentApiBase = import.meta.env.PUBLIC_CONSENT_API_BASE || 'https://conse {title} - + - - - - - + + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 841ac53..19cc07b 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,47 +1,32 @@ --- -import Layout from "@/layouts/Layout.astro" +import Layout from "../layouts/Layout.astro" ---
-
-

- Welcome to Astro Tina Starter -

-

- A modern starter template with Astro 6, Tina CMS, Tailwind CSS 4.x, - and Thai language support. -

+

Welcome to Astro Tina Starter

+

A modern starter template with Astro 6, Tina CMS, and Thai language support.

-
-
-

Tina CMS

-

- Self-hosted content management with schema-based editing. -

-
- -
-

Tailwind v4

-

- Latest Tailwind CSS with @tailwindcss/vite plugin. -

-
- -
-

ConsentOS

-

- PDPA-compliant consent management with auto-blocking tracking. -

-
- -
-

Thai Support

-

- Ready for Thai language content with Noto Sans Thai. -

-
+
+
+

Tina CMS

+

Self-hosted content management with schema-based editing.

-
+ +
+

Astro 6

+

Static site generator with excellent performance.

+
+ +
+

Static HTML

+

No framework dependencies at runtime.

+
+ +
+

Thai Support

+

Ready for Thai language content.

+
+
-
+ \ No newline at end of file diff --git a/src/styles/global.css b/src/styles/global.css deleted file mode 100644 index 4247097..0000000 --- a/src/styles/global.css +++ /dev/null @@ -1,57 +0,0 @@ -@import "tailwindcss"; -@plugin "@tailwindcss/typography"; - -@theme { - --font-sans: "Inter", "Noto Sans Thai", system-ui, sans-serif; - --font-serif: "Merriweather", Georgia, serif; - - --color-primary-50: #f8fafc; - --color-primary-100: #f1f5f9; - --color-primary-200: #e2e8f0; - --color-primary-300: #cbd5e1; - --color-primary-400: #94a3b8; - --color-primary-500: #64748b; - --color-primary-600: #475569; - --color-primary-700: #334155; - --color-primary-800: #1e293b; - --color-primary-900: #0f172a; - --color-primary-950: #020617; - - --color-accent-50: #eff6ff; - --color-accent-100: #dbeafe; - --color-accent-200: #bfdbfe; - --color-accent-300: #93c5fd; - --color-accent-400: #60a5fa; - --color-accent-500: #3b82f6; - --color-accent-600: #2563eb; - --color-accent-700: #1d4ed8; - --color-accent-800: #1e40af; - --color-accent-900: #1e3a8a; - - --color-success-500: #22c55e; - --color-warning-500: #f59e0b; - --color-error-500: #ef4444; - - --radius-sm: 0.25rem; - --radius-md: 0.5rem; - --radius-lg: 0.75rem; - --radius-xl: 1rem; - --radius-2xl: 1.5rem; - --radius-full: 9999px; -} - -html { - scroll-behavior: smooth; -} - -body { - font-family: var(--font-sans); - line-height: 1.6; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -::selection { - background-color: var(--color-accent-200); - color: var(--color-primary-900); -}