@quartz-community/tag-page 1.0.4 → 1.0.5
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 +6 -0
- package/README.md +18 -9
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -5,35 +5,44 @@ Renders tag pages showing all content tagged with a specific tag. Automatically
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx quartz plugin add
|
|
8
|
+
npx quartz plugin add @quartz-community/tag-page
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Tag pages are already in Quartz's default configuration.
|
|
12
|
+
|
|
11
13
|
## Usage
|
|
12
14
|
|
|
13
15
|
```yaml title="quartz.config.yaml"
|
|
14
16
|
plugins:
|
|
15
|
-
- source:
|
|
17
|
+
- source: "@quartz-community/tag-page"
|
|
16
18
|
enabled: true
|
|
19
|
+
options:
|
|
20
|
+
numPages: 10
|
|
21
|
+
prefixTags: false
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
`sort` takes a function, so it needs a TypeScript override:
|
|
20
25
|
|
|
21
26
|
```ts title="quartz.ts (override)"
|
|
22
27
|
import * as ExternalPlugin from "./.quartz/plugins";
|
|
23
28
|
|
|
24
29
|
ExternalPlugin.TagPage({
|
|
25
30
|
numPages: 10,
|
|
26
|
-
|
|
31
|
+
sort: (f1, f2) => (f1.frontmatter?.title ?? "").localeCompare(f2.frontmatter?.title ?? ""),
|
|
27
32
|
});
|
|
28
33
|
```
|
|
29
34
|
|
|
30
35
|
## Configuration
|
|
31
36
|
|
|
32
|
-
| Option | Type | Default
|
|
33
|
-
| ------------ | --------- |
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
+
| Option | Type | Default | Description |
|
|
38
|
+
| ------------ | --------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| `numPages` | `number` | `10` | On the tag index page (`/tags`), the maximum number of pages listed under each tag; a tag's own page lists all of them. |
|
|
40
|
+
| `prefixTags` | `boolean` | `false` | Whether to prefix generated tag page titles with the localized "Tag" label (e.g. "Tag: recipes"). |
|
|
41
|
+
| `sort` | `SortFn` | folders first, then date, title | A function `(f1, f2) => number` to sort the pages with the tag. By default: folders first, then newest first, then by title. Requires a TS override. |
|
|
42
|
+
|
|
43
|
+
`numPages` and `sort` take effect since version 1.0.4.
|
|
44
|
+
|
|
45
|
+
A page with a nested tag such as `#project/alpha` is listed under both `project/alpha` and `project`. Writing a note at `tags/<tag>.md` adds your own text above the generated listing.
|
|
37
46
|
|
|
38
47
|
## Documentation
|
|
39
48
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quartz-community/tag-page",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Tag page type plugin for Quartz.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -102,11 +102,15 @@
|
|
|
102
102
|
"defaultOrder": 50,
|
|
103
103
|
"defaultEnabled": true,
|
|
104
104
|
"defaultOptions": {
|
|
105
|
-
"numPages": 10
|
|
105
|
+
"numPages": 10,
|
|
106
|
+
"prefixTags": false
|
|
106
107
|
},
|
|
107
108
|
"optionSchema": {
|
|
108
109
|
"numPages": {
|
|
109
110
|
"type": "number"
|
|
111
|
+
},
|
|
112
|
+
"prefixTags": {
|
|
113
|
+
"type": "boolean"
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
},
|