Skip to content

Commit 2bc072f

Browse files
committed
#3414 webpage: start with plugin migration
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 8a8355b commit 2bc072f

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

webpage/package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpage/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
"license": "MIT",
1717
"devDependencies": {
1818
"@vuepress/bundler-vite": "next",
19+
"@vuepress/plugin-feed": "next",
1920
"@vuepress/plugin-markdown-chart": "^2.0.0-rc.109",
2021
"@vuepress/plugin-markdown-container": "^2.0.0-rc.30",
2122
"@vuepress/plugin-markdown-ext": "^2.0.0-rc.57",
2223
"@vuepress/plugin-markdown-hint": "^2.0.0-rc.121",
2324
"@vuepress/plugin-markdown-stylize": "^2.0.0-rc.57",
25+
"@vuepress/plugin-seo": "next",
26+
"@vuepress/plugin-sitemap": "next",
2427
"@vuepress/theme-default": "next",
2528
"glob": "^10.3.10",
2629
"lodash-es": "^4.17.21",

webpage/src/.vuepress/config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { createRequire } from "module";
55
import * as utils from "./utils.js";
66
import { markdownChartPlugin } from "@vuepress/plugin-markdown-chart";
77
import { 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

912
const require = createRequire(import.meta.url);
1013
const { 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

Comments
 (0)