|
| 1 | +import { defineConfig } from "vitepress" |
| 2 | +import { createMarkdownConfig } from "./config/markdown.mts" |
| 3 | +import { createViteConfig } from "./config/vite.mts" |
| 4 | +import { createThemeConfig } from "./config/theme.mts" |
| 5 | + |
| 6 | +const themeConfig = createThemeConfig() |
| 7 | + |
| 8 | +const title = "ReActionView" |
| 9 | +const description = "Enhanced ERB templates with Herb engine integration for Rails applications." |
| 10 | + |
| 11 | +// https://vitepress.dev/reference/site-config |
| 12 | +export default defineConfig({ |
| 13 | + title, |
| 14 | + description, |
| 15 | + srcDir: "./docs", |
| 16 | + base: "/reactionview/", |
| 17 | + head: [ |
| 18 | + ['link', { rel: 'icon', href: '/favicon.ico' }], |
| 19 | + ['link', { rel: 'icon', href: '/favicon-16x16.png', sizes: '16x16' }], |
| 20 | + ['link', { rel: 'icon', href: '/favicon-32x32.png', sizes: '32x32' }], |
| 21 | + ['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }], |
| 22 | + ['meta', { property: 'og:image', content: '/social.png' }], |
| 23 | + ['meta', { property: 'og:title', content: 'ReActionView' }], |
| 24 | + ['meta', { property: 'og:description', content: 'Enhanced ERB templates with Herb engine integration for Rails applications.' }], |
| 25 | + ['meta', { property: 'og:url', content: 'https://reactionview.dev' }], |
| 26 | + ['meta', { property: 'og:type', content: 'website' }], |
| 27 | + ], |
| 28 | + cleanUrls: true, |
| 29 | + markdown: createMarkdownConfig(), |
| 30 | + vite: createViteConfig(), |
| 31 | + themeConfig, |
| 32 | + transformPageData(pageData) { |
| 33 | + pageData.frontmatter.head ??= [] |
| 34 | + |
| 35 | + const pageTitle = pageData.frontmatter.title || pageData.title |
| 36 | + |
| 37 | + pageData.frontmatter.head.push([ |
| 38 | + 'meta', |
| 39 | + { |
| 40 | + property: 'og:title', |
| 41 | + content: pageTitle ? `${pageTitle} | ${title}` : `${title} - ${description}` |
| 42 | + } |
| 43 | + ]) |
| 44 | + }, |
| 45 | + |
| 46 | + async buildEnd() { |
| 47 | + console.log('🎉 VitePress build completed successfully') |
| 48 | + } |
| 49 | +}) |
0 commit comments