@@ -5,6 +5,9 @@ import { createRequire } from "module";
55import * as utils from "./utils.js" ;
66import { markdownChartPlugin } from "@vuepress/plugin-markdown-chart" ;
77import { markdownExtPlugin } from "@vuepress/plugin-markdown-ext" ;
8+ import { seoPlugin } from "@vuepress/plugin-seo" ;
9+ import { sitemapPlugin } from "@vuepress/plugin-sitemap" ;
10+ import { feedPlugin } from "@vuepress/plugin-feed" ;
811
912const require = createRequire ( import . meta. url ) ;
1013const { description } = require ( "../../package.json" ) ;
@@ -136,6 +139,50 @@ export default defineUserConfig({
136139 markdownExtPlugin ( {
137140 tasklist : true ,
138141 } ) ,
142+ // SEO plugin - https://ecosystem.vuejs.press/plugins/seo/seo/
143+ seoPlugin ( {
144+ hostname : "https://www.qownnotes.org" ,
145+ canonical : "https://www.qownnotes.org" ,
146+ author : {
147+ name : "Patrizio Bekerle" ,
148+ twitter : "PatrizioBekerle" ,
149+ } ,
150+ ogp : ( ogp , page ) => ( {
151+ ...ogp ,
152+ "og:image" : page . frontmatter . image
153+ ? page . frontmatter . image . startsWith ( "http" )
154+ ? page . frontmatter . image
155+ : `https://www.qownnotes.org${ page . frontmatter . image } `
156+ : "https://www.qownnotes.org/screenshots/screenshot.png" ,
157+ } ) ,
158+ } ) ,
159+ // Sitemap plugin - https://ecosystem.vuejs.press/plugins/seo/sitemap/
160+ sitemapPlugin ( {
161+ hostname : "https://www.qownnotes.org" ,
162+ excludeUrls : [ "/404.html" ] ,
163+ } ) ,
164+ // Feed plugin - https://ecosystem.vuejs.press/plugins/blog/feed/
165+ feedPlugin ( {
166+ hostname : "https://www.qownnotes.org" ,
167+ rss : true ,
168+ atom : true ,
169+ json : true ,
170+ channel : {
171+ title : "QOwnNotes Blog" ,
172+ description :
173+ "News about QOwnNotes, the open source markdown note taking application for Linux, macOS and Windows, that works together with Nextcloud Notes" ,
174+ } ,
175+ filter : ( { frontmatter, filePathRelative } ) => {
176+ // Only include blog posts in the feed
177+ return filePathRelative && filePathRelative . startsWith ( "blog/" ) ;
178+ } ,
179+ sorter : ( a , b ) => {
180+ // Sort by date, newest first
181+ return (
182+ new Date ( b . data . date ) . getTime ( ) - new Date ( a . data . date ) . getTime ( )
183+ ) ;
184+ } ,
185+ } ) ,
139186 ] ,
140187
141188 head : [
0 commit comments