Skip to content

Commit da2ce81

Browse files
committed
新增 SEO 設定 logo 圖示與搜尋引擎驗證 含 sitemap robots OG meta JSON-LD 與 NuGet PackageIcon
1 parent f9293cb commit da2ce81

9 files changed

Lines changed: 346 additions & 5 deletions

File tree

OzaLog/OzaLog/OzaLog.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Website: https://ozakboy.github.io/OzaLog/
6565
<DocumentationFile>file.xml</DocumentationFile>
6666
<PackageReadmeFile>README.md</PackageReadmeFile>
6767

68+
<!-- 套件圖示 (顯示於 NuGet.org 與 IDE 套件管理員) -->
69+
<PackageIcon>logo.png</PackageIcon>
6870

6971
<!-- 授權設定 -->
7072
<PackageLicenseFile>LICENSE</PackageLicenseFile>
@@ -89,6 +91,7 @@ Website: https://ozakboy.github.io/OzaLog/
8991
<PackagePath>\</PackagePath>
9092
</None>
9193
<None Include="..\..\README_zh-TW.md"></None>
94+
<None Include="..\..\logo.png" Pack="True" PackagePath="\" />
9295
</ItemGroup>
9396

9497
<!--

logo.png

128 KB
Loading

site/app.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
<script setup lang="ts">
2+
// JSON-LD 結構化資料 — 讓 Google 認得這是 SoftwareApplication
3+
// 出現在 rich result / knowledge graph 機率提升
4+
const jsonLd = {
5+
'@context': 'https://schema.org',
6+
'@type': 'SoftwareApplication',
7+
name: 'OzaLog',
8+
alternateName: ['OzaLog .NET Logger', 'Ozakboy.NLOG (deprecated, renamed to OzaLog)'],
9+
applicationCategory: 'DeveloperApplication',
10+
applicationSubCategory: 'Logging Library',
11+
operatingSystem: 'Cross-platform (.NET Standard 2.0+, .NET 8/9/10)',
12+
description:
13+
'Lean .NET local file logging library with the simplest possible static API. HFT-grade async pipeline (ConcurrentQueue + persistent FileStream pool + cached timestamp + drop-oldest backpressure). Zero NuGet dependencies on net8.0/9.0/10.0. Designed for high-throughput multi-threaded scenarios like cryptocurrency tick streams.',
14+
url: 'https://ozakboy.github.io/OzaLog/',
15+
downloadUrl: 'https://www.nuget.org/packages/OzaLog/',
16+
image: 'https://ozakboy.github.io/OzaLog/logo.png',
17+
author: {
18+
'@type': 'Person',
19+
name: 'ozakboy',
20+
url: 'https://github.com/ozakboy',
21+
},
22+
license: 'https://opensource.org/licenses/MIT',
23+
programmingLanguage: 'C#',
24+
offers: {
25+
'@type': 'Offer',
26+
price: '0',
27+
priceCurrency: 'USD',
28+
},
29+
softwareVersion: '3.0.1',
30+
}
31+
32+
useHead({
33+
script: [
34+
{
35+
type: 'application/ld+json',
36+
innerHTML: JSON.stringify(jsonLd),
37+
},
38+
],
39+
})
40+
</script>
41+
142
<template>
243
<NuxtLayout>
344
<NuxtPage />

site/layouts/default.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
<script setup>
22
const localePath = useLocalePath()
3+
const config = useRuntimeConfig()
4+
const baseURL = config.app.baseURL || '/'
35
</script>
46

57
<template>
68
<div class="min-h-screen flex flex-col bg-slate-50 text-slate-900">
79
<header class="border-b border-slate-200 bg-white sticky top-0 z-10">
810
<div class="max-w-6xl mx-auto px-4 py-3 flex items-center justify-between gap-4">
911
<NuxtLink :to="localePath('/')" class="flex items-center gap-2">
12+
<img
13+
:src="`${baseURL}logo.png`"
14+
alt="OzaLog logo"
15+
class="w-8 h-8 rounded-full"
16+
width="32"
17+
height="32"
18+
/>
1019
<span class="text-xl font-bold text-brand-700">OzaLog</span>
1120
<span class="text-xs text-slate-500 hidden sm:inline">{{ $t('header.tagline') }}</span>
1221
</NuxtLink>

site/nuxt.config.ts

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ export default defineNuxtConfig({
33
compatibilityDate: '2025-01-01',
44
devtools: { enabled: true },
55

6+
// Nuxt site config (used by sitemap module to prepend absolute URL)
7+
// 注意:url 只能放 domain,baseURL 在 app.baseURL 處理(GitHub Pages project site 規則)
8+
site: {
9+
url: 'https://ozakboy.github.io',
10+
name: 'OzaLog',
11+
description:
12+
'Lean .NET local file logging library with the simplest possible static API. HFT-grade async pipeline, zero NuGet dependencies on net8+. Designed for high-throughput multi-threaded scenarios like cryptocurrency tick streams.',
13+
},
14+
615
app: {
716
baseURL: '/OzaLog/',
817
head: {
@@ -14,17 +23,63 @@ export default defineNuxtConfig({
1423
{
1524
name: 'description',
1625
content:
17-
'OzaLog — a lean, lightweight .NET local file logging library with HFT-grade async pipeline. Zero NuGet dependencies on net8+.',
26+
'OzaLog — a lean, lightweight .NET local file logging library with HFT-grade async pipeline. Zero NuGet dependencies on net8+. NOT related to NLog (formerly Ozakboy.NLOG, renamed v3.0).',
27+
},
28+
{
29+
name: 'keywords',
30+
content:
31+
'OzaLog, .NET logger, csharp logging, HFT logging, local file logger, async logger, zero dependency, NuGet, dotnet, crypto tick stream',
1832
},
19-
{ property: 'og:title', content: 'OzaLog' },
33+
{ name: 'author', content: 'ozakboy' },
34+
35+
// Search engine verification
36+
{
37+
name: 'google-site-verification',
38+
content: '7B6Z2O-JFfFD6I0jeayWg1SFeDWKZmf4RwSVGbQHmVk',
39+
},
40+
{ name: 'msvalidate.01', content: '4928B4223346F74DB53D9754C37164AB' },
41+
42+
// Open Graph (Facebook / LinkedIn / general social)
2043
{ property: 'og:type', content: 'website' },
44+
{ property: 'og:site_name', content: 'OzaLog' },
45+
{ property: 'og:title', content: 'OzaLog — Lean .NET Local File Logger' },
46+
{
47+
property: 'og:description',
48+
content:
49+
'Simplest possible static API. HFT-grade async pipeline. Zero NuGet deps on net8+. Designed for crypto tick stream scenarios.',
50+
},
2151
{ property: 'og:url', content: 'https://ozakboy.github.io/OzaLog/' },
52+
{ property: 'og:image', content: 'https://ozakboy.github.io/OzaLog/logo.png' },
53+
{ property: 'og:image:alt', content: 'OzaLog logo' },
54+
{ property: 'og:locale', content: 'zh_TW' },
55+
{ property: 'og:locale:alternate', content: 'en_US' },
56+
57+
// Twitter Card
58+
{ name: 'twitter:card', content: 'summary' },
59+
{ name: 'twitter:title', content: 'OzaLog — Lean .NET Local File Logger' },
60+
{
61+
name: 'twitter:description',
62+
content:
63+
'Simplest possible static API. HFT-grade async pipeline. Zero NuGet deps on net8+.',
64+
},
65+
{ name: 'twitter:image', content: 'https://ozakboy.github.io/OzaLog/logo.png' },
66+
],
67+
link: [
68+
{ rel: 'icon', type: 'image/png', href: '/OzaLog/logo.png' },
69+
{ rel: 'apple-touch-icon', href: '/OzaLog/logo.png' },
70+
{ rel: 'canonical', href: 'https://ozakboy.github.io/OzaLog/' },
2271
],
23-
link: [{ rel: 'icon', type: 'image/x-icon', href: '/OzaLog/favicon.ico' }],
2472
},
2573
},
2674

27-
modules: ['@nuxtjs/i18n', '@nuxtjs/tailwindcss', '@nuxt/content'],
75+
modules: [
76+
'@nuxtjs/i18n',
77+
'@nuxtjs/tailwindcss',
78+
'@nuxt/content',
79+
'@nuxtjs/sitemap',
80+
// @nuxtjs/robots 不適用(Project Pages baseURL 與 robots.txt root 衝突),
81+
// 改用 site/public/robots.txt 靜態檔
82+
],
2883

2984
// @nuxt/content 預設讀 site/content/。內容由 scripts/sync-docs.mjs 自動從 ../docs/ 同步進來。
3085
content: {
@@ -39,6 +94,7 @@ export default defineNuxtConfig({
3994
},
4095

4196
i18n: {
97+
baseUrl: 'https://ozakboy.github.io',
4298
locales: [
4399
{ code: 'zh-TW', name: '繁體中文', file: 'zh-TW.json' },
44100
{ code: 'en', name: 'English', file: 'en.json' },
@@ -53,7 +109,13 @@ export default defineNuxtConfig({
53109
},
54110
},
55111

56-
// GitHub Pages 部署:使用內建 preset,自動產生 404.html / .nojekyll
112+
// Sitemap: 自動產 sitemap.xml,部署後位於 https://ozakboy.github.io/OzaLog/sitemap.xml
113+
// 自動掃描 pages/ 內路由 + i18n locale 變體
114+
sitemap: {
115+
autoLastmod: true,
116+
},
117+
118+
// GitHub Pages 部署:使用內建 preset,自動產生 404.html / .nojekyll
57119
nitro: {
58120
preset: 'github_pages',
59121
},

0 commit comments

Comments
 (0)