|
| 1 | +import baseConfig from '@cakephp/docs-skeleton/config' |
| 2 | + |
| 3 | +import { createRequire } from "module"; |
| 4 | +const require = createRequire(import.meta.url); |
| 5 | +const toc_en = require("./toc_en.json"); |
| 6 | +const toc_ja = require("./toc_ja.json"); |
| 7 | + |
| 8 | +const versions = { |
| 9 | + text: "5.x", |
| 10 | + items: [ |
| 11 | + { text: "5.x (latest)", link: "https://book.cakephp.org/5.x/", target: '_self' }, |
| 12 | + { text: "4.x", link: "https://book.cakephp.org/4.x/", target: '_self' }, |
| 13 | + { text: "3.x", link: "https://book.cakephp.org/3.x/", target: '_self' }, |
| 14 | + { text: "2.x", link: "https://book.cakephp.org/2.x/", target: '_self' }, |
| 15 | + { text: "Next releases", items: [ |
| 16 | + { text: "5.next", link: "https://book.cakephp.org/5.next/", target: '_self' }, |
| 17 | + { text: "6.x", link: "https://book.cakephp.org/6.x/", target: '_self' }, |
| 18 | + ]}, |
| 19 | + ], |
| 20 | +}; |
| 21 | + |
| 22 | +// This file contains overrides for .vitepress/config.js |
| 23 | +export default { |
| 24 | + extends: baseConfig, |
| 25 | + base: "/5.x/", |
| 26 | + rewrites: { |
| 27 | + "en/:slug*": ":slug*", |
| 28 | + }, |
| 29 | + sitemap: { |
| 30 | + hostname: "https://book.cakephp.org/5.x/", |
| 31 | + }, |
| 32 | + themeConfig: { |
| 33 | + socialLinks: [ |
| 34 | + { icon: "github", link: "https://github.com/cakephp/cakephp" }, |
| 35 | + ], |
| 36 | + editLink: { |
| 37 | + pattern: "https://github.com/cakephp/docs/edit/5.x/docs/:path", |
| 38 | + text: "Edit this page on GitHub", |
| 39 | + }, |
| 40 | + sidebar: toc_en, |
| 41 | + nav: [ |
| 42 | + { text: "Guide", link: "/intro" }, |
| 43 | + { text: "API", link: "https://api.cakephp.org/" }, |
| 44 | + { text: "Documentation", link: "/" }, |
| 45 | + { ...versions }, |
| 46 | + ], |
| 47 | + }, |
| 48 | + substitutions: { |
| 49 | + '|phpversion|': { value: '8.5', format: 'bold' }, |
| 50 | + '|minphpversion|': { value: '8.2', format: 'italic' }, |
| 51 | + '|cakeversion|': '5.3', |
| 52 | + '|cakefullversion|': 'CakePHP 5', |
| 53 | + }, |
| 54 | + locales: { |
| 55 | + root: { |
| 56 | + label: "English", |
| 57 | + lang: "en", |
| 58 | + }, |
| 59 | + ja: { |
| 60 | + label: "Japanese", |
| 61 | + lang: "ja", |
| 62 | + themeConfig: { |
| 63 | + nav: [ |
| 64 | + { text: "ガイド", link: "/ja/intro" }, |
| 65 | + { text: "API", link: "https://api.cakephp.org/" }, |
| 66 | + { text: "ドキュメント", link: "/ja/" }, |
| 67 | + { ...versions }, |
| 68 | + ], |
| 69 | + sidebar: toc_ja, |
| 70 | + }, |
| 71 | + }, |
| 72 | + }, |
| 73 | +}; |
0 commit comments