diff --git a/README.md b/README.md index 910e042..19b796c 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,18 @@ bun run preview ## Deployment +- **Custom domain (SEO & GEO)**: Set `PUBLIC_SITE_URL=https://your-domain.com` in your build environment so canonical URLs, bidirectional `hreflang`, `sitemap.xml`, `robots.txt`, `llms.txt`, `llms-full.txt`, Open Graph tags, and Schema.org JSON-LD resolve to your production domain automatically. - **Cloudflare Pages**: Build command `pnpm run build` (or `bun run build`), output directory `dist`. - **Cloudflare Workers Static Assets**: Run `bun run build` then `npx wrangler deploy`. +## SEO & GEO Endpoints + +- `/sitemap.xml` — Bilingual Sitemap 0.9 with bidirectional `xhtml:link` `hreflang` alternates +- `/robots.txt` — RFC 9309 directives with explicit AI search & grounding crawler support +- `/llms.txt` & `/llms-full.txt` — `llmstxt.org` standard index & full single-file Markdown context +- `/index.md`, `/docs/.md`, `/en/docs/.md` — Clean Markdown mirrors linked via `` +- `/og-image.png` & `/site.webmanifest` — `1200×630` Open Graph card & Web App Manifest + ## Notice For personal study and research only. Reims-Go distributes no Apple files or system images. Platform names and schematic icons shown on this website are used solely for compatibility identification; all trademarks belong to their respective owners (Microsoft Corporation, Apple Inc., Khronos Group). Not affiliated with Apple Inc., Microsoft Corporation, or upstream `reims-vgpu`. diff --git a/astro.config.mjs b/astro.config.mjs index 3dc4394..35150a9 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,8 +3,10 @@ import react from '@astrojs/react'; import mdx from '@astrojs/mdx'; import tailwindcss from '@tailwindcss/vite'; +const SITE_URL = (process.env.PUBLIC_SITE_URL || process.env.SITE_URL || 'https://reims-go.pages.dev').replace(/\/+$/, ''); + export default defineConfig({ - site: 'https://reims-go.pages.dev', + site: SITE_URL, output: 'static', trailingSlash: 'ignore', prefetch: { diff --git a/package.json b/package.json index bb74aab..dd980c7 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "astro dev", "sync:data": "node scripts/sync-external-data.mjs", + "gen:og": "node scripts/generate-og.mjs", "build": "astro check && astro build && pagefind --site dist", "build:fast": "astro build && pagefind --site dist", "preview": "astro preview", diff --git a/public/_headers b/public/_headers index f254a00..59bfe8e 100644 --- a/public/_headers +++ b/public/_headers @@ -8,3 +8,32 @@ /pagefind/* Cache-Control: public, max-age=86400 + X-Robots-Tag: noindex + +/sitemap.xml + Content-Type: application/xml; charset=utf-8 + Cache-Control: public, max-age=3600 + +/robots.txt + Content-Type: text/plain; charset=utf-8 + Cache-Control: public, max-age=3600 + +/llms.txt + Content-Type: text/plain; charset=utf-8 + Cache-Control: public, max-age=3600 + +/llms-full.txt + Content-Type: text/plain; charset=utf-8 + Cache-Control: public, max-age=3600 + +/index.md + Content-Type: text/markdown; charset=utf-8 + Cache-Control: public, max-age=3600 + +/docs/*.md + Content-Type: text/markdown; charset=utf-8 + Cache-Control: public, max-age=3600 + +/en/docs/*.md + Content-Type: text/markdown; charset=utf-8 + Cache-Control: public, max-age=3600 diff --git a/public/og-image.png b/public/og-image.png new file mode 100644 index 0000000..46e30b9 Binary files /dev/null and b/public/og-image.png differ diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..31a0653 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,16 @@ +{ + "name": "Reims-Go — macOS Virtual Machine for Windows", + "short_name": "Reims-Go", + "description": "GPU-accelerated macOS virtual machine desktop launcher and CLI workbench for Windows 10/11 x64.", + "start_url": "/", + "display": "standalone", + "background_color": "#FFFFFF", + "theme_color": "#007AFF", + "icons": [ + { + "src": "/logo.svg", + "sizes": "any", + "type": "image/svg+xml" + } + ] +} diff --git a/scripts/generate-og.mjs b/scripts/generate-og.mjs new file mode 100644 index 0000000..e65a3c4 --- /dev/null +++ b/scripts/generate-og.mjs @@ -0,0 +1,133 @@ +import { writeFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; +import { resolve } from 'node:path'; + +const astroReq = createRequire(import.meta.resolve('astro')); +const sharp = astroReq('sharp'); + +const ogSvg = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + v0.2.11 · Apache-2.0 · Zero Telemetry + + + + + + + + + + + + + + + + + + + A macOS virtual machine + for Windows 10 & 11 + + + Metal to Vulkan 1.3 discrete GPU acceleration. + Single EXE workbench, zero-CLI setup, Guest Tools v8. + + + + + Metal → Vulkan 1.3 + + + macOS Tahoe 26 + + + GUI + CLI Single EXE + + + + + + + + + + + + Reims-Go + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 09:41 + + + + + + + + + + reims-graphics-pci · Vulkan 1.3 + +`; + +const outPath = resolve(process.cwd(), 'public/og-image.png'); +const pngBuffer = await sharp(Buffer.from(ogSvg)).png({ compressionLevel: 9 }).toBuffer(); +writeFileSync(outPath, pngBuffer); +console.log(`Generated ${outPath} (${pngBuffer.length} bytes)`); diff --git a/src/components/home/HomePage.astro b/src/components/home/HomePage.astro index 00c5b23..be9b2b3 100644 --- a/src/components/home/HomePage.astro +++ b/src/components/home/HomePage.astro @@ -3,6 +3,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro'; import { t } from '../../i18n/translations'; import { localizedPath, type Locale } from '../../i18n/types'; import { FALLBACK_RELEASE } from '../../lib/releases'; +import { buildHomeJsonLd } from '../../lib/seo'; import { WordmarkBrush } from '../brand/WordmarkBrush'; import { HeroHeadline } from './HeroHeadline'; import { HeroWindowPreview } from './HeroWindowPreview'; @@ -20,9 +21,16 @@ interface Props { const { locale } = Astro.props; const strings = t(locale); const releaseVer = FALLBACK_RELEASE.version; +const homeJsonLd = buildHomeJsonLd(locale); --- - +
diff --git a/src/components/pages/ChangelogView.astro b/src/components/pages/ChangelogView.astro index 3dad8a9..3cfc6cf 100644 --- a/src/components/pages/ChangelogView.astro +++ b/src/components/pages/ChangelogView.astro @@ -1,6 +1,8 @@ --- import BaseLayout from '../../layouts/BaseLayout.astro'; +import { t } from '../../i18n/translations'; import type { Locale } from '../../i18n/types'; +import { buildSubpageJsonLd } from '../../lib/seo'; interface Props { locale: Locale; @@ -148,14 +150,24 @@ const releases = isZh ], }, ]; +const pageTitle = isZh ? '更新日志' : 'Changelog'; +const pageDesc = isZh ? 'Reims-Go 客户端各正式版本功能演进与修复记录' : 'Release history and improvements for Reims-Go'; +const changelogJsonLd = buildSubpageJsonLd({ + locale, + path: '/changelog', + title: pageTitle, + description: pageDesc, + navLabel: t(locale).nav.changelog, +}); ---
diff --git a/src/components/pages/CompatibilityView.astro b/src/components/pages/CompatibilityView.astro index 00f07f0..79b6c75 100644 --- a/src/components/pages/CompatibilityView.astro +++ b/src/components/pages/CompatibilityView.astro @@ -1,6 +1,8 @@ --- import BaseLayout from '../../layouts/BaseLayout.astro'; +import { t } from '../../i18n/translations'; import { localizedPath, type Locale } from '../../i18n/types'; +import { buildSubpageJsonLd } from '../../lib/seo'; interface Props { locale: Locale; @@ -38,14 +40,26 @@ const osRows = isZh { item: 'Storage', req: '150 GB+ free outside system drive (NVMe recommended)', detail: 'Defaults to NVMe qcow2 with extended_l2 subclusters; runtimes and images stay inside your chosen data folder' }, { item: 'Guest macOS', req: 'Focused on macOS Tahoe 26', detail: 'Installers are downloaded directly from Apple by your machine; report other setups in community' }, ]; +const pageTitle = isZh ? '硬件兼容与运行要求' : 'Hardware Compatibility'; +const pageDesc = isZh + ? 'Reims-Go 显卡 Vulkan 1.3 兼容矩阵、Windows 10/11 虚拟化前提与 VMware SVGA 回退说明' + : 'GPU Vulkan 1.3 compatibility matrix, Windows WHPX requirements, and VMware SVGA fallback guide'; +const compatJsonLd = buildSubpageJsonLd({ + locale, + path: '/compatibility', + title: pageTitle, + description: pageDesc, + navLabel: t(locale).nav.compatibility, +}); ---
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index a083625..c96c831 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -3,6 +3,16 @@ import { ClientRouter } from 'astro:transitions'; import '../styles/global.css'; import { t } from '../i18n/translations'; import type { Locale } from '../i18n/types'; +import { + canonicalUrl, + getHreflangAlternates, + OG_IMAGE_HEIGHT, + OG_IMAGE_PATH, + OG_IMAGE_WIDTH, + SITE_KEYWORDS, + SITE_NAME, + SITE_URL, +} from '../lib/seo'; import Navbar from '../components/layout/Navbar.astro'; import Footer from '../components/layout/Footer.astro'; @@ -12,6 +22,10 @@ interface Props { description?: string; activeSection?: 'features' | 'docs' | 'plugins' | 'compatibility' | 'changelog'; showFooterCta?: boolean; + ogType?: 'website' | 'article'; + noindex?: boolean; + markdownAlternate?: string; + jsonLd?: Record | null; } const { @@ -20,11 +34,29 @@ const { description, activeSection = 'features', showFooterCta = true, + ogType = 'website', + noindex = false, + markdownAlternate, + jsonLd, } = Astro.props; const strings = t(locale); -const pageTitle = title ? `${title} · Reims-Go` : strings.meta.title; +const pageTitle = title ? `${title} · ${SITE_NAME}` : strings.meta.title; const pageDesc = description || strings.meta.description; +const pathname = Astro.url.pathname; +const canonical = canonicalUrl(pathname); +const alternates = getHreflangAlternates(pathname); +const ogImageUrl = `${SITE_URL}${OG_IMAGE_PATH}`; +const ogImageAlt = locale === 'zh-CN' + ? 'Reims-Go — 为 Windows 打造的 Metal 经 Vulkan 硬件加速 macOS 虚拟机' + : 'Reims-Go — Metal to Vulkan GPU-accelerated macOS virtual machine for Windows'; +const ogLocale = locale === 'zh-CN' ? 'zh_CN' : 'en_US'; +const ogAltLocale = locale === 'zh-CN' ? 'en_US' : 'zh_CN'; +const robotsContent = noindex + ? 'noindex, nofollow' + : 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'; +const keywords = SITE_KEYWORDS[locale].join(', '); +const markdownAltUrl = markdownAlternate ? canonicalUrl(markdownAlternate) : null; --- @@ -34,10 +66,47 @@ const pageDesc = description || strings.meta.description; {pageTitle} + + + + + + + + + + {markdownAltUrl && } + + {!noindex && ( + <> + + + + + + )} + + + + - + + + + + + + + + + + + + + {jsonLd &&