Skip to content

Commit ff5773e

Browse files
committed
新增 介紹網站 site/ (Nuxt 3 + Vue 3 + Tailwind + 雙語 i18n) 與 GitHub Pages 自動部署 workflow
1 parent 2ce5f94 commit ff5773e

21 files changed

Lines changed: 693 additions & 0 deletions

.github/workflows/deploy-site.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'site/**'
8+
- '.github/workflows/deploy-site.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
working-directory: site
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: npm
33+
cache-dependency-path: site/package-lock.json
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Generate static site
39+
run: npm run generate
40+
41+
- name: Upload Pages artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: site/.output/public
45+
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- id: deployment
54+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,16 @@ STRATEGIC-DECISIONS.md
246246
# BenchmarkDotNet 輸出(會在每次跑 benchmark 後重生成,不該入版控)
247247
BenchmarkDotNet.Artifacts/
248248

249+
################################################################################
250+
# Nuxt 3 site (site/) — 介紹網站建置產物
251+
################################################################################
252+
site/node_modules/
253+
site/.nuxt/
254+
site/.output/
255+
site/.data/
256+
site/.cache/
257+
site/dist/
258+
site/.env
259+
site/.env.*
260+
site/*.log
261+

site/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# OzaLog Site
2+
3+
OzaLog 介紹網站(Nuxt 3 + Vite + Vue 3 + Tailwind CSS + i18n)。
4+
部署至 GitHub Pages:<https://ozakboy.github.io/OzaLog/>
5+
6+
## 開發
7+
8+
```bash
9+
cd site
10+
npm install
11+
npm run dev # http://localhost:3000
12+
```
13+
14+
## 建置(產生靜態檔案)
15+
16+
```bash
17+
npm run generate # 輸出至 .output/public/
18+
```
19+
20+
## 部署
21+
22+
push 到 `main` 並改動 `site/**` 會自動觸發 [.github/workflows/deploy-site.yml](../.github/workflows/deploy-site.yml),由 GitHub Actions 建置並部署到 GitHub Pages。
23+
24+
## 結構
25+
26+
```
27+
site/
28+
├── nuxt.config.ts # baseURL: '/OzaLog/'、i18n、Tailwind 設定
29+
├── app.vue # 根元件
30+
├── layouts/default.vue # 共用 header / footer
31+
├── pages/ # 自動路由
32+
├── components/ # 共用元件
33+
├── locales/ # i18n(zh-TW.json / en.json)
34+
└── tailwind.config.js
35+
```
36+
37+
## 雙語
38+
39+
- 預設語系:`zh-TW`(URL 為 `/`
40+
- 英文:`/en/`
41+
- 切換:layout header 右側 LanguageSwitcher
42+
43+
## GitHub Pages 設定提醒
44+
45+
首次部署前需在 repo Settings → Pages → Source 選 **"GitHub Actions"**

site/app.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<NuxtLayout>
3+
<NuxtPage />
4+
</NuxtLayout>
5+
</template>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup>
2+
const { locale, locales } = useI18n()
3+
const switchLocalePath = useSwitchLocalePath()
4+
5+
const otherLocale = computed(() => {
6+
const others = locales.value.filter((l) => l.code !== locale.value)
7+
return others[0]
8+
})
9+
</script>
10+
11+
<template>
12+
<NuxtLink
13+
v-if="otherLocale"
14+
:to="switchLocalePath(otherLocale.code)"
15+
class="text-xs hover:text-brand-700 border border-slate-300 px-2 py-1 rounded"
16+
>
17+
{{ otherLocale.code === 'zh-TW' ? '繁中' : 'EN' }}
18+
</NuxtLink>
19+
</template>

site/layouts/default.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<script setup>
2+
const localePath = useLocalePath()
3+
</script>
4+
5+
<template>
6+
<div class="min-h-screen flex flex-col bg-slate-50 text-slate-900">
7+
<header class="border-b border-slate-200 bg-white sticky top-0 z-10">
8+
<div class="max-w-6xl mx-auto px-4 py-3 flex items-center justify-between gap-4">
9+
<NuxtLink :to="localePath('/')" class="flex items-center gap-2">
10+
<span class="text-xl font-bold text-brand-700">OzaLog</span>
11+
<span class="text-xs text-slate-500 hidden sm:inline">{{ $t('header.tagline') }}</span>
12+
</NuxtLink>
13+
<nav class="flex items-center gap-4 sm:gap-6 text-sm">
14+
<NuxtLink :to="localePath('/docs')" class="hover:text-brand-700">{{ $t('nav.docs') }}</NuxtLink>
15+
<NuxtLink :to="localePath('/benchmarks')" class="hover:text-brand-700 hidden sm:inline">{{ $t('nav.benchmarks') }}</NuxtLink>
16+
<NuxtLink :to="localePath('/migration')" class="hover:text-brand-700 hidden md:inline">{{ $t('nav.migration') }}</NuxtLink>
17+
<NuxtLink :to="localePath('/changelog')" class="hover:text-brand-700 hidden md:inline">{{ $t('nav.changelog') }}</NuxtLink>
18+
<NuxtLink :to="localePath('/sponsor')" class="hover:text-brand-700">{{ $t('nav.sponsor') }}</NuxtLink>
19+
<a href="https://github.com/ozakboy/OzaLog" target="_blank" rel="noopener" class="hover:text-brand-700">GitHub</a>
20+
<LanguageSwitcher />
21+
</nav>
22+
</div>
23+
</header>
24+
25+
<main class="flex-1">
26+
<slot />
27+
</main>
28+
29+
<footer class="border-t border-slate-200 bg-white mt-16">
30+
<div class="max-w-6xl mx-auto px-4 py-6 text-sm text-slate-500 flex flex-col sm:flex-row items-center justify-between gap-2">
31+
<span>&copy; {{ new Date().getFullYear() }} ozakboy. MIT License.</span>
32+
<div class="flex gap-4">
33+
<a href="https://www.nuget.org/packages/OzaLog/" target="_blank" rel="noopener" class="hover:text-brand-700">NuGet</a>
34+
<a href="https://github.com/ozakboy/OzaLog" target="_blank" rel="noopener" class="hover:text-brand-700">GitHub</a>
35+
</div>
36+
</div>
37+
</footer>
38+
</div>
39+
</template>

site/locales/en.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"header": {
3+
"tagline": ".NET local file logger"
4+
},
5+
"nav": {
6+
"docs": "Docs",
7+
"benchmarks": "Benchmarks",
8+
"migration": "Migration",
9+
"changelog": "Changelog",
10+
"sponsor": "Sponsor"
11+
},
12+
"home": {
13+
"hero": {
14+
"title": "OzaLog",
15+
"subtitle": "Lean. Minimal API. HFT-grade async pipeline. A local file logging library built for .NET applications.",
16+
"install": "Install Now",
17+
"github": "View on GitHub"
18+
},
19+
"features": {
20+
"title": "Core Features",
21+
"items": {
22+
"simple": {
23+
"title": "Minimal API",
24+
"desc": "One line LOG.Info_Log(\"...\") — no DI, no LoggerFactory."
25+
},
26+
"hft": {
27+
"title": "HFT-grade Async",
28+
"desc": "ConcurrentQueue + persistent FileStream pool + 1ms cached timestamp + drop-oldest backpressure."
29+
},
30+
"zerodep": {
31+
"title": "Zero Dependencies",
32+
"desc": "Zero NuGet dependencies on net8.0 / net9.0 / net10.0."
33+
},
34+
"thread": {
35+
"title": "Thread-safe",
36+
"desc": "Thread-safe by default; designed for high-throughput multi-threaded scenarios like crypto tick streams."
37+
}
38+
}
39+
},
40+
"quickstart": {
41+
"title": "Quick Start",
42+
"step1": "1. Install the package",
43+
"step2": "2. Use immediately",
44+
"step3": "3. (Optional) Configure"
45+
}
46+
},
47+
"docs": {
48+
"title": "Documentation",
49+
"intro": "Pick a topic below to get started with OzaLog.",
50+
"sections": {
51+
"gettingStarted": "Getting Started",
52+
"configuration": "Configuration",
53+
"api": "API Reference",
54+
"asyncPipeline": "HFT Async Architecture"
55+
},
56+
"wip": "Page content coming soon — see README.md in the GitHub repo."
57+
},
58+
"benchmarks": {
59+
"title": "Benchmarks",
60+
"intro": "OzaLog measured head-to-head against ZLogger, ZeroLog, and Serilog with BenchmarkDotNet.",
61+
"wip": "Detailed charts coming soon — see the OzaLog.Benchmarks project in the GitHub repo."
62+
},
63+
"migration": {
64+
"title": "v2.x → v3.0 Migration Guide",
65+
"intro": "Complete guide for upgrading from Ozakboy.NLOG v2.x to OzaLog v3.0.",
66+
"wip": "Full guide coming soon — see MIGRATION.md in the GitHub repo."
67+
},
68+
"changelog": {
69+
"title": "Changelog",
70+
"intro": "See CHANGELOG.md in the GitHub repo for the full history."
71+
},
72+
"sponsor": {
73+
"title": "Sponsor",
74+
"intro": "If OzaLog helps you, consider sponsoring the developer via cryptocurrency.",
75+
"crypto": {
76+
"title": "Cryptocurrency Wallets",
77+
"btc": "Bitcoin (BTC)",
78+
"eth": "Ethereum (ETH)",
79+
"usdt": "USDT (TRC20)",
80+
"placeholder": "(Address coming soon)"
81+
}
82+
}
83+
}

site/locales/zh-TW.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"header": {
3+
"tagline": ".NET 本地日誌函式庫"
4+
},
5+
"nav": {
6+
"docs": "文件",
7+
"benchmarks": "效能對比",
8+
"migration": "升級指南",
9+
"changelog": "版本歷史",
10+
"sponsor": "贊助"
11+
},
12+
"home": {
13+
"hero": {
14+
"title": "OzaLog",
15+
"subtitle": "輕量、極簡 API、HFT 級異步——專為 .NET 應用設計的本地檔案日誌函式庫。",
16+
"install": "立即安裝",
17+
"github": "查看 GitHub"
18+
},
19+
"features": {
20+
"title": "核心特色",
21+
"items": {
22+
"simple": {
23+
"title": "極簡 API",
24+
"desc": "一行 LOG.Info_Log(\"...\") 即可使用,無需 DI、無需 LoggerFactory。"
25+
},
26+
"hft": {
27+
"title": "HFT 級異步",
28+
"desc": "ConcurrentQueue + 持久化 FileStream 池 + 1ms 快取時間戳 + drop-oldest 壓力控制。"
29+
},
30+
"zerodep": {
31+
"title": "零依賴",
32+
"desc": "net8.0 / net9.0 / net10.0 完全零 NuGet 依賴。"
33+
},
34+
"thread": {
35+
"title": "線程安全",
36+
"desc": "預設線程安全,支援多執行緒併發場景如加密貨幣報價串流。"
37+
}
38+
}
39+
},
40+
"quickstart": {
41+
"title": "快速開始",
42+
"step1": "1. 安裝套件",
43+
"step2": "2. 立即使用",
44+
"step3": "3. (選用) 自訂配置"
45+
}
46+
},
47+
"docs": {
48+
"title": "文件",
49+
"intro": "選擇下方主題開始學習 OzaLog。",
50+
"sections": {
51+
"gettingStarted": "快速開始",
52+
"configuration": "配置選項",
53+
"api": "API 參考",
54+
"asyncPipeline": "HFT 異步架構"
55+
},
56+
"wip": "本頁內容整理中,完整資訊請參考 GitHub repo 的 README_zh-TW.md。"
57+
},
58+
"benchmarks": {
59+
"title": "效能對比",
60+
"intro": "OzaLog 與 ZLogger / ZeroLog / Serilog 的 BenchmarkDotNet 實測對比。",
61+
"wip": "詳細圖表整理中,請參考 GitHub repo 的 OzaLog.Benchmarks 專案。"
62+
},
63+
"migration": {
64+
"title": "v2.x → v3.0 升級指南",
65+
"intro": "從 Ozakboy.NLOG v2.x 升級至 OzaLog v3.0 的完整指南。",
66+
"wip": "完整指南請見 GitHub repo 的 MIGRATION.md。"
67+
},
68+
"changelog": {
69+
"title": "版本歷史",
70+
"intro": "完整變更紀錄請見 GitHub repo 的 CHANGELOG_zh-TW.md。"
71+
},
72+
"sponsor": {
73+
"title": "贊助",
74+
"intro": "如果 OzaLog 對您有幫助,歡迎透過加密貨幣錢包贊助開發者。",
75+
"crypto": {
76+
"title": "加密貨幣錢包",
77+
"btc": "Bitcoin (BTC)",
78+
"eth": "Ethereum (ETH)",
79+
"usdt": "USDT (TRC20)",
80+
"placeholder": "(地址尚未公開,敬請期待)"
81+
}
82+
}
83+
}

0 commit comments

Comments
 (0)