Parin's Space
返回文章列表

Hello World

· 閱讀時間 1 分鐘

歡迎來到我的技術部落格!這裡記錄技術學習、系統架構與日常思考。

技術棧

這個部落格使用以下技術建立:

  • Astro — 靜態網站生成器,Zero JS by default,頁面載入極快
  • TailwindCSS — Utility-first CSS,搭配 Typography plugin 排版文章
  • Content Collections — Type-safe Markdown 管理,frontmatter 驗證
  • Shiki — 內建語法高亮,支援多種主題
  • Cloudflare Pages — 全球 CDN,push to deploy,PR preview 自動產生
  • GitHub Actions — CI/CD,負責 build 與部署觸發

新增文章

src/content/blog/ 下建立新的 .md.mdx 檔案:

---
title: "文章標題"
date: "2026-01-01"
summary: "文章摘要,顯示在列表與 Open Graph"
tags: ["go", "k8s"]
cover_image: "/images/cover.jpg"  # 可選
published: true
---

文章內文...

檔名即為 URL slug:my-post.md/blog/my-post

commit 並 push 到 main,GitHub Actions 自動 build 並部署到 Cloudflare Pages。

程式碼範例

package main

import "fmt"

func main() {
    fmt.Println("Hello, Blog!")
}
// Astro Content Collection
import { getCollection } from "astro:content";

const posts = await getCollection("blog", ({ data }) => data.published);
# 本地開發
cd frontend
npm install
npm run dev  # http://localhost:4321

# 部署:push 即可
git add .
git commit -m "post: hello world"
git push