File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ export default withMermaid(defineConfig({
125125
126126 transformPageData ( pageData ) {
127127 const head = pageData . frontmatter . head ??= [ ]
128+
129+ // Inject canonical URL if not already defined in frontmatter
128130 const hasCanonical = head . some (
129131 ( [ tag , attrs ] ) => tag === 'link' && attrs ?. rel === 'canonical'
130132 )
@@ -134,6 +136,12 @@ export default withMermaid(defineConfig({
134136 . replace ( / \. m d $ / , '' )
135137 head . push ( [ 'link' , { rel : 'canonical' , href : canonicalUrl } ] )
136138 }
139+
140+ // Inject frontmatter keywords as a meta tag (VitePress doesn't do this natively)
141+ const keywords = pageData . frontmatter . keywords
142+ if ( keywords ) {
143+ head . push ( [ 'meta' , { name : 'keywords' , content : keywords } ] )
144+ }
137145 } ,
138146
139147 themeConfig : {
You can’t perform that action at this time.
0 commit comments