|
1 | | -import { defineConfig } from 'vitepress'; |
2 | 1 | import dotenv from 'dotenv'; |
3 | | - |
| 2 | +import { defineConfig, HeadConfig } from 'vitepress' |
4 | 3 | //const dotenv = require('dotenv'); |
5 | 4 |
|
6 | 5 | dotenv.config(); |
7 | 6 |
|
| 7 | +const base_url = process.env.VITEPRESS_BASE_URL || 'https://github.com/codeboxrcodehub/comforthrmdocs'; |
| 8 | + |
8 | 9 | export default { |
| 10 | + sitemap: { |
| 11 | + hostname: base_url |
| 12 | + }, |
| 13 | + transformHead: ({ pageData }) => { |
| 14 | + const head: HeadConfig[] = []; |
| 15 | + |
| 16 | + head.push(['meta', { property: 'keywords', content: pageData.frontmatter.keywords }]); |
| 17 | + |
| 18 | + |
| 19 | + head.push(['meta', { property: 'og:site_name', content: pageData.frontmatter.site_name }]); |
| 20 | + head.push(['meta', { property: 'og:title', content: pageData.frontmatter.title }]); |
| 21 | + head.push(['meta', { property: 'og:description', content: pageData.frontmatter.description }]); |
| 22 | + head.push(['meta', { property: 'og:keywords', content: pageData.frontmatter.keywords }]); |
| 23 | + head.push(['meta', { property: 'og:type', content: pageData.frontmatter.type }]); |
| 24 | + head.push(['meta', { property: 'og:url', content: base_url + pageData.frontmatter.url }]); |
| 25 | + head.push(['meta', { property: 'og:image', content: pageData.frontmatter.image }]); |
| 26 | + |
| 27 | + head.push(['meta', { property: 'twitter:site', content: pageData.frontmatter.site_name }]); |
| 28 | + head.push(['meta', { property: 'twitter:title', content: pageData.frontmatter.title }]); |
| 29 | + head.push(['meta', { property: 'twitter:description', content: pageData.frontmatter.description }]); |
| 30 | + head.push(['meta', { property: 'twitter:keywords', content: pageData.frontmatter.keywords }]); |
| 31 | + head.push(['meta', { property: 'twitter:card', content: pageData.frontmatter.type }]); |
| 32 | + head.push(['meta', { property: 'twitter:url', content: base_url + pageData.frontmatter.url }]); |
| 33 | + head.push(['meta', { property: 'twitter:image', content: pageData.frontmatter.image }]); |
| 34 | + |
| 35 | + return head |
| 36 | + }, |
9 | 37 | title: "Comfort HRM", |
10 | 38 | description: "An awesome docs template built by me", |
11 | 39 | lang: 'en-US', |
|
0 commit comments