@knolljo/astro-sveltia-cms 0.0.1 → 0.2.0
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/README.md +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ import sveltia from "astro-sveltia-cms";
|
|
|
19
19
|
export default defineConfig({
|
|
20
20
|
integrations: [
|
|
21
21
|
sveltia({
|
|
22
|
-
|
|
22
|
+
route: "/cms", // Optional, defaults to "/admin"
|
|
23
|
+
title: "My CMS", // Optional, defaults to "Sveltia CMS"
|
|
23
24
|
config: {
|
|
24
25
|
load_config_file: false,
|
|
25
26
|
backend: {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ export type SveltiaOptions = {
|
|
|
5
5
|
* The route where the CMS will be served.
|
|
6
6
|
* @default "/admin"
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
route?: string;
|
|
9
9
|
/**
|
|
10
10
|
* The page title for the CMS admin interface.
|
|
11
|
-
* @default "
|
|
11
|
+
* @default "Sveltia CMS"
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
title?: string;
|
|
14
14
|
/**
|
|
15
15
|
* The Sveltia CMS configuration object.
|
|
16
16
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default function sveltiaCms(options) {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const route = options.route || "/admin";
|
|
3
|
+
const title = options.title || "Sveltia CMS";
|
|
4
4
|
const virtualModuleId = "virtual:astro-sveltia-cms/config";
|
|
5
5
|
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
6
6
|
return {
|
|
@@ -9,7 +9,7 @@ export default function sveltiaCms(options) {
|
|
|
9
9
|
"astro:config:setup": ({ injectRoute, updateConfig, logger }) => {
|
|
10
10
|
// Inject the admin page route
|
|
11
11
|
injectRoute({
|
|
12
|
-
pattern:
|
|
12
|
+
pattern: route,
|
|
13
13
|
entrypoint: new URL("./admin.astro", import.meta.url),
|
|
14
14
|
});
|
|
15
15
|
// Register the virtual module plugin
|
|
@@ -27,7 +27,7 @@ export default function sveltiaCms(options) {
|
|
|
27
27
|
if (id === resolvedVirtualModuleId) {
|
|
28
28
|
return `
|
|
29
29
|
export const config = ${JSON.stringify(options.config)};
|
|
30
|
-
export const title = ${JSON.stringify(
|
|
30
|
+
export const title = ${JSON.stringify(title)};
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -35,7 +35,7 @@ export default function sveltiaCms(options) {
|
|
|
35
35
|
],
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
|
-
logger.info(`Sveltia CMS injected at ${
|
|
38
|
+
logger.info(`Sveltia CMS injected at ${route}`);
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
};
|