|
| 1 | +import {defineConfig} from 'vitepress' |
| 2 | +import fetch from "node-fetch"; |
| 3 | + |
| 4 | +let version = 'beta'; |
| 5 | +let changelog = ''; |
| 6 | +await fetch('https://api.github.com/repos/tweakphp/tweakphp/releases/latest') |
| 7 | + .then(response => response.json()).then((data: any) => { |
| 8 | + version = data.tag_name; |
| 9 | + changelog = data.html_url; |
| 10 | + }); |
| 11 | + |
| 12 | +// https://vitepress.dev/reference/site-config |
| 13 | +export default defineConfig({ |
| 14 | + base: '/', |
| 15 | + title: "TweakPHP", |
| 16 | + description: "Easily tweak your PHP code", |
| 17 | + head: [ |
| 18 | + // [ |
| 19 | + // 'script', |
| 20 | + // { |
| 21 | + // src: 'https://www.googletagmanager.com/gtag/js?id=G-9N4ER7K7M6', |
| 22 | + // }, |
| 23 | + // ], |
| 24 | + // [ |
| 25 | + // 'script', |
| 26 | + // {}, |
| 27 | + // "window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-9N4ER7K7M6');", |
| 28 | + // ] |
| 29 | + ], |
| 30 | + themeConfig: { |
| 31 | + logo: "/icon.png", |
| 32 | + |
| 33 | + nav: [ |
| 34 | + { |
| 35 | + text: 'Docs', |
| 36 | + items: [ |
| 37 | + {text: 'Get Started', link: '/getting-started/introduction'}, |
| 38 | + {text: 'Installation', link: '/getting-started/installation'}, |
| 39 | + ] |
| 40 | + }, |
| 41 | + { |
| 42 | + text: version, |
| 43 | + items: [ |
| 44 | + {text: 'Changelog', link: changelog}, |
| 45 | + {text: 'Contribute', link: '/prologue/contribution-guide'}, |
| 46 | + ] |
| 47 | + } |
| 48 | + ], |
| 49 | + |
| 50 | + // search: { |
| 51 | + // provider: 'algolia', |
| 52 | + // options: { |
| 53 | + // appId: '', |
| 54 | + // apiKey: '', |
| 55 | + // indexName: '', |
| 56 | + // } |
| 57 | + // }, |
| 58 | + |
| 59 | + sidebar: [ |
| 60 | + { |
| 61 | + text: 'Prologue', |
| 62 | + items: [ |
| 63 | + {text: 'Contribution Guide', link: '/prologue/contribution-guide'} |
| 64 | + ] |
| 65 | + }, |
| 66 | + { |
| 67 | + text: 'Getting Started', |
| 68 | + items: [ |
| 69 | + {text: 'Introduction', link: '/getting-started/introduction'}, |
| 70 | + {text: 'Installation', link: '/getting-started/installation'}, |
| 71 | + {text: 'Settings', link: '/getting-started/settings'}, |
| 72 | + ] |
| 73 | + }, |
| 74 | + {text: 'Start Tweaking', link: '/start'}, |
| 75 | + {text: 'Docker', link: '/docker'}, |
| 76 | + {text: 'SSH', link: '/ssh'}, |
| 77 | + {text: 'Client Library', link: '/client'}, |
| 78 | + ], |
| 79 | + socialLinks: [ |
| 80 | + {icon: 'github', link: 'https://github.com/tweakphp/tweakphp'}, |
| 81 | + {icon: 'discord', link: 'https://discord.gg/Et3UTT4xwC'}, |
| 82 | + {icon: 'twitter', link: 'https://twitter.com/saeed_vz'}, |
| 83 | + {icon: 'youtube', link: 'https://www.youtube.com/@saeedvaziry'}, |
| 84 | + ], |
| 85 | + footer: { |
| 86 | + message: 'Made with ❤️', |
| 87 | + copyright: 'Copyright © 2024-present Saeed Vaziry' |
| 88 | + } |
| 89 | + } |
| 90 | +}) |
0 commit comments