@quartz-community/remove-draft 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - Initial Quartz community plugin template.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Quartz Community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @quartz-community/remove-draft
2
+
3
+ Filters out pages with draft: true in their frontmatter.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx quartz plugin add github:quartz-community/remove-draft
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```yaml title="quartz.config.yaml"
14
+ plugins:
15
+ - source: github:quartz-community/remove-draft
16
+ enabled: true
17
+ ```
18
+
19
+ ## Configuration
20
+
21
+ This plugin has no configuration options.
22
+
23
+ ## Documentation
24
+
25
+ See the [Quartz documentation](https://quartz.jzhao.xyz/plugins/RemoveDrafts) for more information.
26
+
27
+ ## License
28
+
29
+ MIT
@@ -0,0 +1,6 @@
1
+ import { QuartzFilterPlugin } from '@quartz-community/types';
2
+ export { QuartzFilterPlugin } from '@quartz-community/types';
3
+
4
+ declare const RemoveDrafts: QuartzFilterPlugin<object>;
5
+
6
+ export { RemoveDrafts };
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ // src/filter.ts
2
+ var RemoveDrafts = () => ({
3
+ name: "RemoveDrafts",
4
+ shouldPublish(_ctx, [_tree, vfile]) {
5
+ const frontmatter = vfile.data?.frontmatter;
6
+ const draftFlag = frontmatter?.draft === true || frontmatter?.draft === "true";
7
+ return !draftFlag;
8
+ }
9
+ });
10
+
11
+ export { RemoveDrafts };
12
+ //# sourceMappingURL=index.js.map
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/filter.ts"],"names":[],"mappings":";AAEO,IAAM,eAA2C,OAAO;AAAA,EAC7D,IAAA,EAAM,cAAA;AAAA,EACN,aAAA,CAAc,IAAA,EAAM,CAAC,KAAA,EAAO,KAAK,CAAA,EAAG;AAClC,IAAA,MAAM,WAAA,GAAc,MAAM,IAAA,EAAM,WAAA;AAChC,IAAA,MAAM,SAAA,GAAqB,WAAA,EAAa,KAAA,KAAU,IAAA,IAAQ,aAAa,KAAA,KAAU,MAAA;AACjF,IAAA,OAAO,CAAC,SAAA;AAAA,EACV;AACF,CAAA","file":"index.js","sourcesContent":["import type { QuartzFilterPlugin } from \"@quartz-community/types\";\n\nexport const RemoveDrafts: QuartzFilterPlugin<object> = () => ({\n name: \"RemoveDrafts\",\n shouldPublish(_ctx, [_tree, vfile]) {\n const frontmatter = vfile.data?.frontmatter as Record<string, unknown> | undefined;\n const draftFlag: boolean = frontmatter?.draft === true || frontmatter?.draft === \"true\";\n return !draftFlag;\n },\n});\n"]}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@quartz-community/remove-draft",
3
+ "version": "0.1.0",
4
+ "description": "Filter plugin that removes draft pages from Quartz builds",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Quartz Community",
8
+ "homepage": "https://github.com/quartz-community/remove-draft",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/quartz-community/remove-draft"
12
+ },
13
+ "keywords": [
14
+ "quartz",
15
+ "quartz-plugin",
16
+ "filter",
17
+ "draft"
18
+ ],
19
+ "files": [
20
+ "dist",
21
+ "README.md",
22
+ "LICENSE",
23
+ "CHANGELOG.md"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "main": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "sideEffects": false,
35
+ "scripts": {
36
+ "build": "tsup",
37
+ "dev": "tsup --watch",
38
+ "lint": "eslint . --max-warnings=0",
39
+ "format": "prettier . --check",
40
+ "test": "vitest run",
41
+ "typecheck": "tsc --noEmit",
42
+ "check": "npm run typecheck && npm run lint && npm run format && npm run test",
43
+ "prepublishOnly": "npm run build"
44
+ },
45
+ "dependencies": {
46
+ "@quartz-community/types": "^0.2.1"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^24.10.0",
50
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
51
+ "@typescript-eslint/parser": "^7.18.0",
52
+ "eslint": "^8.57.0",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "prettier": "^3.6.2",
55
+ "tsup": "^8.5.0",
56
+ "typescript": "^5.9.3",
57
+ "vitest": "^2.1.9"
58
+ },
59
+ "quartz": {
60
+ "name": "remove-draft",
61
+ "displayName": "Remove Drafts",
62
+ "category": "filter",
63
+ "version": "1.0.0",
64
+ "quartzVersion": ">=5.0.0",
65
+ "dependencies": [],
66
+ "defaultOrder": 50,
67
+ "defaultEnabled": true,
68
+ "defaultOptions": {}
69
+ },
70
+ "engines": {
71
+ "node": ">=22",
72
+ "npm": ">=10.9.2"
73
+ },
74
+ "publishConfig": {
75
+ "access": "public"
76
+ }
77
+ }