Run a virtual iPhone on an Apple Silicon Mac.
Swift
import fs from 'node:fs';
import path from 'node:path';
import { defineConfig } from '@rspress/core';
// docs/ is generated by `npm run sync` (scripts/sync-docs.mjs).
const docs = path.join(__dirname, 'docs');
const sidebars = JSON.parse(fs.readFileSync(path.join(docs, 'sidebars.json'), 'utf8'));
// Site chrome per language. The manual is translated; the research notes are English only.
const languages = [
{ lang: 'en', label: 'English', prefix: '', manual: 'Manual', research: 'Research', downloads: 'Downloads', tagline: 'Run a virtual iPhone on an Apple Silicon Mac.' },
{ lang: 'zh', label: '简体中文', prefix: '/zh', manual: '手册', research: '研究笔记', downloads: '下载', tagline: '在 Apple Silicon Mac 上运行虚拟 iPhone。' },
{ lang: 'ja', label: '日本語', prefix: '/ja', manual: 'マニュアル', research: '研究ノート', downloads: 'ダウンロード', tagline: 'Apple Silicon Mac で仮想 iPhone を動かします。' },
{ lang: 'ko', label: '한국어', prefix: '/ko', manual: '매뉴얼', research: '연구 노트', downloads: '다운로드', tagline: 'Apple Silicon Mac에서 가상 iPhone을 실행합니다.' },
];
const manualSections = '^/(?:zh/|ja/|ko/)?(?:get-started|machines|firmware|storage|networking|launchpad|help)/';
export default defineConfig({
root: docs,
// GitHub Pages serves the project site under /vphone-cli/; previews use the same path.
base: '/vphone-cli/',
title: 'vphone',
description: languages[0].tagline,
lang: 'en',
locales: languages.map(({ lang, label, tagline }) => ({ lang, label, title: 'vphone', description: tagline })),
globalStyles: path.join(__dirname, 'theme/index.css'),
globalUIComponents: [path.join(__dirname, 'theme/ResearchLanguageLinks.tsx')],
route: {
exclude: ['sidebars.json'],
},
markdown: {
link: { checkDeadLinks: true },
},
themeConfig: {
darkMode: true,
enableContentAnimation: false,
socialLinks: [{ icon: 'github', mode: 'link', content: 'https://github.com/Lakr233/vphone-cli' }],
footer: { message: 'vphone-cli · MIT License' },
locales: languages.map(({ lang, label, prefix, manual, research, downloads, tagline }) => ({
lang,
label,
title: 'vphone',
description: tagline,
nav: [
{ text: manual, link: `${prefix}/get-started/overview`, activeMatch: manualSections },
{ text: downloads, link: `${prefix}/get-started/downloads` },
// Rspress prefixes links in a translated locale; the research notes are English only.
{ text: research, link: prefix ? 'https://lakr233.github.io/vphone-cli/research/' : '/research/', activeMatch: '^/research/' },
],
sidebar: prefix ? { [`${prefix}/`]: sidebars[lang] } : { '/': sidebars.en, '/research/': sidebars.research },
})),
},
});