@quartz-community/tag-page 1.0.3 → 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 +12 -0
- package/README.md +18 -9
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 56dd9d8: The manifest declares the `prefixTags` option (default `false`), so option checks and Quartz Syncer know it.
|
|
8
|
+
|
|
9
|
+
## 1.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4487502: The `numPages` and `sort` options take effect. Quartz builds a page type's body with `body(undefined)`, and the tag listing was passed in directly, so it never received the plugin's options and always used its defaults.
|
|
14
|
+
|
|
3
15
|
## 1.0.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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/dist/index.js
CHANGED
|
@@ -2897,7 +2897,9 @@ var TagPage = (opts) => ({
|
|
|
2897
2897
|
return virtualPages;
|
|
2898
2898
|
},
|
|
2899
2899
|
layout: "tag",
|
|
2900
|
-
body:
|
|
2900
|
+
// Quartz calls body(undefined): pass this plugin's options through, or numPages and sort
|
|
2901
|
+
// never reach the tag listing
|
|
2902
|
+
body: () => TagContent_default(opts)
|
|
2901
2903
|
});
|
|
2902
2904
|
|
|
2903
2905
|
export { TagContent_default as TagContent, TagPage };
|