@studiocms/blog 0.1.0-beta.17 → 0.1.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +66 -54
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { definePlugin } from "studiocms/plugins";
|
|
|
4
4
|
const packageIdentifier = "@studiocms/blog";
|
|
5
5
|
function studioCMSBlogPlugin(options) {
|
|
6
6
|
const title = options?.blog?.title || "Blog";
|
|
7
|
-
const enableRSS = options?.blog?.enableRSS
|
|
7
|
+
const enableRSS = options?.blog?.enableRSS ?? true;
|
|
8
8
|
const route = pathWithBase(options?.blog?.route || "/blog");
|
|
9
9
|
const sitemap = options?.sitemap ?? true;
|
|
10
10
|
const injectRoutes = options?.injectRoutes ?? true;
|
|
@@ -12,63 +12,75 @@ function studioCMSBlogPlugin(options) {
|
|
|
12
12
|
return definePlugin({
|
|
13
13
|
identifier: packageIdentifier,
|
|
14
14
|
name: "StudioCMS Blog",
|
|
15
|
-
studiocmsMinimumVersion: "0.1.0-beta.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
15
|
+
studiocmsMinimumVersion: "0.1.0-beta.17",
|
|
16
|
+
hooks: {
|
|
17
|
+
"studiocms:astro:config": ({ addIntegrations }) => {
|
|
18
|
+
addIntegrations({
|
|
19
|
+
name: packageIdentifier,
|
|
20
|
+
hooks: {
|
|
21
|
+
"astro:config:setup": async (params) => {
|
|
22
|
+
const { injectRoute } = params;
|
|
23
|
+
if (injectRoutes) {
|
|
24
|
+
injectRoute({
|
|
25
|
+
entrypoint: resolve("./routes/[...slug].astro"),
|
|
26
|
+
pattern: pathWithBase("[...slug]"),
|
|
27
|
+
prerender: false
|
|
28
|
+
});
|
|
29
|
+
injectRoute({
|
|
30
|
+
entrypoint: resolve("./routes/blog/index.astro"),
|
|
31
|
+
pattern: `${route}`,
|
|
32
|
+
prerender: false
|
|
33
|
+
});
|
|
34
|
+
injectRoute({
|
|
35
|
+
entrypoint: resolve("./routes/blog/[...slug].astro"),
|
|
36
|
+
pattern: `${route}/[...slug]`,
|
|
37
|
+
prerender: false
|
|
38
|
+
});
|
|
39
|
+
if (enableRSS) {
|
|
40
|
+
injectRoute({
|
|
41
|
+
entrypoint: resolve("./routes/rss.xml.js"),
|
|
42
|
+
pattern: pathWithBase("rss.xml"),
|
|
43
|
+
prerender: false
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
addVirtualImports(params, {
|
|
48
|
+
name: packageIdentifier,
|
|
49
|
+
imports: {
|
|
50
|
+
"studiocms:blog/config": `
|
|
51
|
+
const config = {
|
|
52
|
+
title: ${JSON.stringify(title)},
|
|
53
|
+
enableRSS: ${enableRSS},
|
|
54
|
+
route: ${JSON.stringify(route)}
|
|
55
|
+
}
|
|
56
|
+
export default config;
|
|
57
|
+
`
|
|
58
|
+
}
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
"studiocms:config:setup": ({ setFrontend, setRendering, setSitemap }) => {
|
|
65
|
+
setFrontend({
|
|
66
|
+
frontendNavigationLinks: [{ label: title, href: route }]
|
|
67
|
+
});
|
|
68
|
+
setRendering({
|
|
69
|
+
pageTypes: [{ identifier: packageIdentifier, label: "Blog Post (StudioCMS Blog)" }]
|
|
70
|
+
});
|
|
71
|
+
setSitemap({
|
|
72
|
+
triggerSitemap: sitemap,
|
|
73
|
+
sitemaps: [
|
|
74
|
+
{
|
|
75
|
+
pluginName: packageIdentifier,
|
|
76
|
+
sitemapXMLEndpointPath: resolve("./routes/sitemap-posts.xml.js")
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
pluginName: "pages",
|
|
80
|
+
sitemapXMLEndpointPath: resolve("./routes/sitemap-md.xml.js")
|
|
69
81
|
}
|
|
70
|
-
|
|
71
|
-
}
|
|
82
|
+
]
|
|
83
|
+
});
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiocms/blog",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.18",
|
|
4
4
|
"description": "Add a blog to your StudioCMS project with ease!",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Matthiesen | Jacob Jenkins | Paul Valladares",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"astro": "^5.7.1",
|
|
65
65
|
"vite": "^6.2.6",
|
|
66
|
-
"studiocms": "0.1.0-beta.
|
|
66
|
+
"studiocms": "0.1.0-beta.18"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "buildkit build 'src/**/*.{ts,astro,css,json,png}'",
|