@rmdes/indiekit-post-type-page 1.0.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/index.js +40 -0
- package/package.json +34 -0
package/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page post type for Indiekit
|
|
3
|
+
*
|
|
4
|
+
* Creates root-level "slash pages" like /about, /now, /uses, /colophon, etc.
|
|
5
|
+
* These are static pages that don't have dates in their URLs.
|
|
6
|
+
*
|
|
7
|
+
* @see https://slashpages.net for slash page inspiration
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const defaults = {
|
|
11
|
+
name: "Page",
|
|
12
|
+
fields: {
|
|
13
|
+
name: { required: true }, // Page title (e.g., "About", "Now", "Uses")
|
|
14
|
+
summary: {}, // Optional page description
|
|
15
|
+
content: { required: true }, // Page content
|
|
16
|
+
category: {}, // Optional categories/tags
|
|
17
|
+
"post-status": {}, // draft or published
|
|
18
|
+
visibility: {}, // public, unlisted, private
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default class PagePostType {
|
|
23
|
+
name = "Page post type";
|
|
24
|
+
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.options = { ...defaults, ...options };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get config() {
|
|
30
|
+
return {
|
|
31
|
+
name: this.options.name,
|
|
32
|
+
h: "entry",
|
|
33
|
+
fields: this.options.fields,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
init(Indiekit) {
|
|
38
|
+
Indiekit.addPostType("page", this);
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rmdes/indiekit-post-type-page",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Page post type for Indiekit - creates root-level slash pages like /about, /now, /uses",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"indiekit",
|
|
7
|
+
"indiekit-plugin",
|
|
8
|
+
"indieweb",
|
|
9
|
+
"post-type",
|
|
10
|
+
"page",
|
|
11
|
+
"slash-pages"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/rmdes/indiekit-post-type-page",
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Ricardo Mendes",
|
|
16
|
+
"url": "https://rmendes.net"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "index.js",
|
|
24
|
+
"files": [
|
|
25
|
+
"index.js"
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/rmdes/indiekit-post-type-page.git"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|