{"id":27086796,"url":"https://github.com/leawind/docs-template","last_synced_at":"2025-04-06T05:38:26.545Z","repository":{"id":225085798,"uuid":"764998519","full_name":"LEAWIND/docs-template","owner":"LEAWIND","description":"A documentation template build by vitepress","archived":false,"fork":false,"pushed_at":"2024-04-30T13:21:32.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-05-02T07:56:36.705Z","etag":null,"topics":["documentation"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LEAWIND.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-29T04:59:02.000Z","updated_at":"2024-05-02T07:56:36.705Z","dependencies_parsed_at":"2024-02-29T07:27:26.342Z","dependency_job_id":"42580869-d96a-41ee-94f1-a49650771360","html_url":"https://github.com/LEAWIND/docs-template","commit_stats":null,"previous_names":["leawind/docs-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEAWIND%2Fdocs-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEAWIND%2Fdocs-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEAWIND%2Fdocs-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEAWIND%2Fdocs-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LEAWIND","download_url":"https://codeload.github.com/LEAWIND/docs-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441031,"owners_count":20939233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation"],"created_at":"2025-04-06T05:38:26.124Z","updated_at":"2025-04-06T05:38:26.529Z","avatar_url":"https://github.com/LEAWIND.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"| [English](./README.md) | 中文 |\n| ---------------------- | ---- |\n\n# docs-template\n\n一个使用 vitepress 构建的文档模板\n\n查看 [在线示例](https://leawind.github.io/docs-template/zh-CN/?autolang)\n\n## 特性\n\n* **国际化** 支持多语言\n* **中文搜索（不完美）**\n* 当URL中没有指定语言代码时，自动重定向到浏览器语言\n  * `/` -\u003e `/en-US/`\n  * `/Donate` -\u003e `/en-US/Donate`\n* **URL参数解析**\n  * `?search=%s` 一旦页面加载完成，自动打开搜索框并搜索。\n  * `?autolang` 自动跳转到浏览器的默认语言\n    * `/zh-CN/changelog` -\u003e `/en-US/changelog`\n\n# 问题\n\n## 如何添加新的语言支持\n\n例如，语言标识为 `ru`。\n\n1. 创建文件夹 `docs/ru`\n2. 添加语言配置 `docs/.vitepress/locales/ru.mts`\n3. 在 `docs/.vitepress/locales.mts` 中添加语言定义\n\t```ts {4}\n\tconst langs = [\n\t\t'en-US',\n\t\t'zh-CN',\n\t\t'ru',\n\t];\n\n\t...\n\t```\n\n## 如何添加新的区块\n\n例如，区块名称为 `readme`。\n\n1. 创建目录 `docs/readme/`\n2. 创建索引页面 `docs/readme/index.md`\n3. 添加到导航栏\n\t编辑 `docs/.vitepress/locales/` 下每个语言脚本\n\t```ts {6-7,12-13}\n\t...\n\n\t\tthemeConfig: {\n\t\t\tnav: [\n\t\t\t\t...\n\t\t\t\t// 添加到导航栏\n\t\t\t\t{ text: 'Readme', link: `/${lang}/readme/` },\n\t\t\t],\n\t\t\tsidebar: {\n\t\t\t\t...\n\n\t\t\t\t// 自动生成侧边栏\n\t\t\t\t'/zh-CN/readme': buildSidebar(`/${lang}/readme`),\n\t\t\t}\n\t\t}\n\n\t...\n\t```\n\n## 如何更改 Base 路径（默认为 `/`）\n\n例如，将 Base 路径设置为 `Third-Person`。\n\n只需修改 `.vitepress/config.mts` 文件\n\n```ts {2}\nexport default defineConfig({\n\tbase: 'Third-Person',\n\n...\n});\n```\n\n## 如何更改源根目录（通常为 `.`）\n\n例如，将源根目录更改为 `pages`。\n\n1. 编辑 `docs/.vitepress/config.mts` 文件\n\t```ts {2}\n\texport default defineConfig({\n\t\tsrcDir: 'pages',\n\n\t\t...\n\t})\n\t```\n2. 编辑 `docs/.vitepress/builders.mts` 文件\n\t```ts\n\texport function buildSidebar(dir: string, docsRoot: string = 'pages'): any {\n\n\t\t...\n\t```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleawind%2Fdocs-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleawind%2Fdocs-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleawind%2Fdocs-template/lists"}