|
| 1 | +import dotenv from 'dotenv'; |
| 2 | +import { defineConfig, HeadConfig } from 'vitepress' |
| 3 | + |
| 4 | +dotenv.config(); |
| 5 | + |
| 6 | +const base_url = process.env.VITEPRESS_BASE_URL || 'https://github.com/codeboxrcodehub/comforterpdocs'; |
| 7 | + |
| 8 | +export default { |
| 9 | + sitemap: { |
| 10 | + hostname: base_url |
| 11 | + }, |
| 12 | + transformHead: ({ pageData }) => { |
| 13 | + const head: HeadConfig[] = []; |
| 14 | + |
| 15 | + head.push(['meta', { property: 'keywords', content: pageData.frontmatter.keywords }]); |
| 16 | + |
| 17 | + |
| 18 | + head.push(['meta', { property: 'og:site_name', content: pageData.frontmatter.site_name }]); |
| 19 | + head.push(['meta', { property: 'og:title', content: pageData.frontmatter.title }]); |
| 20 | + head.push(['meta', { property: 'og:description', content: pageData.frontmatter.description }]); |
| 21 | + head.push(['meta', { property: 'og:keywords', content: pageData.frontmatter.keywords }]); |
| 22 | + head.push(['meta', { property: 'og:type', content: pageData.frontmatter.type }]); |
| 23 | + head.push(['meta', { property: 'og:url', content: base_url + pageData.frontmatter.url }]); |
| 24 | + head.push(['meta', { property: 'og:image', content: pageData.frontmatter.image }]); |
| 25 | + |
| 26 | + head.push(['meta', { property: 'twitter:site', content: pageData.frontmatter.site_name }]); |
| 27 | + head.push(['meta', { property: 'twitter:title', content: pageData.frontmatter.title }]); |
| 28 | + head.push(['meta', { property: 'twitter:description', content: pageData.frontmatter.description }]); |
| 29 | + head.push(['meta', { property: 'twitter:keywords', content: pageData.frontmatter.keywords }]); |
| 30 | + head.push(['meta', { property: 'twitter:card', content: pageData.frontmatter.type }]); |
| 31 | + head.push(['meta', { property: 'twitter:url', content: base_url + pageData.frontmatter.url }]); |
| 32 | + head.push(['meta', { property: 'twitter:image', content: pageData.frontmatter.image }]); |
| 33 | + |
| 34 | + return head |
| 35 | + }, |
| 36 | + title: "Comfort ERP", |
| 37 | + description: "An awesome docs template built by me", |
| 38 | + lang: 'en-US', |
| 39 | + // cleanUrls: true, |
| 40 | + base: process.env.VITEPRESS_BASE || '/comforterpdocs/', // Default to '/' if the variable is not set |
| 41 | + // If this is disabled, when building it it will give deadlink errors if your markdown has the wrong links |
| 42 | + ignoreDeadLinks: true, |
| 43 | + |
| 44 | + themeConfig: { |
| 45 | + logo: "/logo.png", |
| 46 | + siteTitle: "", |
| 47 | + search: { |
| 48 | + provider: "local", |
| 49 | + }, |
| 50 | + // Navbar Link |
| 51 | + nav: [ |
| 52 | + { text: "Accounting", link: "/comfortaccounting/" }, |
| 53 | + { text: "Form", link: "/comfortform/" }, |
| 54 | + ], |
| 55 | + //Social Icons |
| 56 | + socialLinks: [ |
| 57 | + { icon: "github", link: "https://github.com/codeboxrcodehub/comforterpdocs" }, |
| 58 | + { icon: "twitter", link: "https://twitter.com/victorekea" }, |
| 59 | + //{ icon: "discord", link: "..." }, |
| 60 | + { |
| 61 | + icon: { |
| 62 | + svg: '<svg role="img" width="26.01" height="32" viewBox="0 0 256 315"><path d="M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.387 39.475 13.662 51.889 13.662c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.822M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.64-22.262"/></svg>', |
| 63 | + }, |
| 64 | + link: "https://google.com", |
| 65 | + }, |
| 66 | + ], |
| 67 | + |
| 68 | + sidebar: { |
| 69 | + // Sidebar for `/docs/` section |
| 70 | + '/comfortaccounting/': [ |
| 71 | + { |
| 72 | + text: 'Comfort Accounting', |
| 73 | + collapsible: false, |
| 74 | + }, |
| 75 | + { |
| 76 | + text: 'Getting Started', |
| 77 | + collapsible: true, |
| 78 | + items: [ |
| 79 | + { text: 'How to install', link: '/comfortaccounting/how-to-install' }, |
| 80 | + { text: 'How to Translate', link: '/comfortaccounting/how-to-translate' }, |
| 81 | + { text: 'Template Override', link: '/comfortaccounting/template-override' }, |
| 82 | + { text: 'Hooks and Filters', link: '/comfortaccounting/hooks-and-filters' }, |
| 83 | + { text: 'Code Samples', link: '/comfortaccounting/code-samples' }, |
| 84 | + ], |
| 85 | + }, |
| 86 | + { |
| 87 | + text: 'Shortcode', |
| 88 | + collapsible: true, |
| 89 | + items: [ |
| 90 | + { text: '9 Shortcodes', link: '/comfortaccounting/shortcodes' }, |
| 91 | + ], |
| 92 | + }, |
| 93 | + { |
| 94 | + text: 'Widgets', |
| 95 | + collapsible: true, |
| 96 | + items: [ |
| 97 | + { text: 'Classic Widgets', link: '/comfortaccounting/classic-widgets' }, |
| 98 | + { text: 'Elementor Widget', link: '/comfortaccounting/elementor-widgets' }, |
| 99 | + { text: 'Gutenberg Blocks', link: '/comfortaccounting/gutenberg-blocks' }, |
| 100 | + ], |
| 101 | + } |
| 102 | + ], |
| 103 | + |
| 104 | + |
| 105 | + // Sidebar for `/guide/` section |
| 106 | + '/comfortform/': [ |
| 107 | + { |
| 108 | + text: 'Comfort Form', |
| 109 | + collapsible: true, |
| 110 | + items: [ |
| 111 | + { text: 'How to install', link: '/comfortform/how-to-install' }, |
| 112 | + { text: 'How to Translate', link: '/comfortform/how-to-translate' }, |
| 113 | + { text: 'Template Override', link: '/comfortform/template-override' }, |
| 114 | + { text: 'Shortcodes', link: '/comfortform/shortcodes' }, |
| 115 | + { text: 'Classic Widgets', link: '/comfortform/classic-widgets' }, |
| 116 | + { text: 'Elementor Widget', link: '/comfortform/elementor-widgets' }, |
| 117 | + { text: 'Gutenberg Blocks', link: '/comfortform/gutenberg-blocks' }, |
| 118 | + { text: 'Hooks and Filters', link: '/comfortform/hooks-and-filters' }, |
| 119 | + { text: 'Code Samples', link: '/comfortform/code-samples' }, |
| 120 | + ], |
| 121 | + }, |
| 122 | + ], |
| 123 | + }, |
| 124 | + // you can disable the previous and next page here |
| 125 | + docFooter: { |
| 126 | + prev: 'Previous', |
| 127 | + next: 'Next', |
| 128 | + }, |
| 129 | + editLink: { |
| 130 | + pattern: 'https://github.com/codeboxrcodehub/comforterpdocs/edit/main/docs/:path', |
| 131 | + text: 'Edit this page on GitHub' |
| 132 | + }, |
| 133 | + footer: { |
| 134 | + message: "Released under the MIT License.", |
| 135 | + copyright: "Copyright © 2024-present Comfort ERP", |
| 136 | + }, |
| 137 | + markdown: { |
| 138 | + theme: "material-palenight", |
| 139 | + lineNumbers: true, |
| 140 | + }, |
| 141 | + // Mobile Config only |
| 142 | + returnToTopLabel: 'Go to Top', |
| 143 | + sidebarMenuLabel: 'Menu', |
| 144 | + }, |
| 145 | +}; |
0 commit comments