@binarynoir/vitepress-blog 0.3.0 → 0.5.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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BlogAnnouncementData, a as BlogAnnouncementItem, b as BlogAuthor, c as BlogFeedConfig, d as BlogIndexConfig, e as BlogLabels, f as BlogLayout, g as BlogOptions, h as BlogPostData, i as BlogScope, D as DEFAULT_LABELS, j as blogMarkdown } from './plugin-Bb4rRwO8.cjs';
1
+ export { B as BlogAnnouncementData, a as BlogAnnouncementItem, b as BlogAuthor, c as BlogFeedConfig, d as BlogGroupBy, e as BlogIndexConfig, f as BlogLabels, g as BlogLayout, h as BlogOptions, i as BlogPostData, j as BlogScope, D as DEFAULT_LABELS, k as blogMarkdown } from './plugin-kzO68Abz.cjs';
2
2
  import 'markdown-it';
3
3
 
4
4
  /** Marker a blog page can use to say where its list of posts goes. Without it the list is appended. */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BlogAnnouncementData, a as BlogAnnouncementItem, b as BlogAuthor, c as BlogFeedConfig, d as BlogIndexConfig, e as BlogLabels, f as BlogLayout, g as BlogOptions, h as BlogPostData, i as BlogScope, D as DEFAULT_LABELS, j as blogMarkdown } from './plugin-Bb4rRwO8.js';
1
+ export { B as BlogAnnouncementData, a as BlogAnnouncementItem, b as BlogAuthor, c as BlogFeedConfig, d as BlogGroupBy, e as BlogIndexConfig, f as BlogLabels, g as BlogLayout, h as BlogOptions, i as BlogPostData, j as BlogScope, D as DEFAULT_LABELS, k as blogMarkdown } from './plugin-kzO68Abz.js';
2
2
  import 'markdown-it';
3
3
 
4
4
  /** Marker a blog page can use to say where its list of posts goes. Without it the list is appended. */
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  POST_FRONTMATTER_KEY,
6
6
  WIDGET_NAME,
7
7
  blogMarkdown
8
- } from "./chunk-LYTJBMVK.js";
8
+ } from "./chunk-FPFH7ORO.js";
9
9
  import "./chunk-42Z6H7IN.js";
10
10
  export {
11
11
  BLOG_POSTS_PLACEHOLDER,
@@ -64,10 +64,12 @@ interface BlogOptions {
64
64
  */
65
65
  pageSize?: number;
66
66
  /**
67
- * Most sticky posts pinned to the top of a blog page, for those that don't
68
- * set `stickyLimit`. Extra sticky posts take their place by date. `0` pins
69
- * them all. Default: `0`.
67
+ * Most `pinned: true` posts kept at the top of a blog page, for those that
68
+ * don't set `pinLimit`. Extra pinned posts take their place by date. `0`
69
+ * pins them all. Default: `0`.
70
70
  */
71
+ pinLimit?: number;
72
+ /** @deprecated Renamed `pinLimit`; still read when `pinLimit` isn't set. */
71
73
  stickyLimit?: number;
72
74
  /**
73
75
  * Show a "Subscribe" RSS link on blog pages and `::: blog-posts` blocks,
@@ -75,7 +77,7 @@ interface BlogOptions {
75
77
  * on a site with a site URL (without one, no feeds are written). Default: `true`.
76
78
  */
77
79
  rssLink?: boolean;
78
- /** Words the plugin writes on pages, for translating. `{n}`, `{blog}` and `{tag}` are filled in. */
80
+ /** Words the plugin writes on pages, for translating. `{n}`, `{blog}`, `{filter}` and `{row}` are filled in. */
79
81
  labels?: Partial<BlogLabels>;
80
82
  }
81
83
  interface BlogLabels {
@@ -94,29 +96,49 @@ interface BlogLabels {
94
96
  /** The link back to a post's blog: "All posts in {blog}". */
95
97
  allPosts: string;
96
98
  draft: string;
97
- /** Badge on a sticky post. */
98
- sticky: string;
99
+ /** Badge on a pinned post. */
100
+ pinned: string;
99
101
  /** Badge on an announcement, and the accessible name of the announcement banner. */
100
102
  announcement: string;
101
- /** Above a blog page filtered to announcements (`?announcements`). */
103
+ /** A blog page's announcements filter (`?announcements`), in the active filters. */
102
104
  announcements: string;
103
- /** When the blog page has no announcements to show. */
104
- noAnnouncements: string;
105
105
  /** Tooltip of the banner's count badge: "{n} announcements". */
106
106
  announcementCount: string;
107
107
  /** Accessible name of the banner's close button. */
108
108
  dismiss: string;
109
109
  noPosts: string;
110
- /** Year heading for posts without a date, when a blog groups by year. */
110
+ /** Group heading for posts without a date, when a blog groups by year or month. */
111
111
  undated: string;
112
- /** Label of a blog page's keyword list. */
112
+ /** Accessible name of the browse panel above a blog page's posts. */
113
+ browse: string;
114
+ /** Label of the browse panel's category row. */
115
+ categories: string;
116
+ /** Label of the browse panel's keyword row. */
113
117
  tags: string;
114
- /** Above a list filtered by keyword: "Posts tagged {tag}". */
115
- tagged: string;
116
- /** Link that clears the keyword filter. */
118
+ /** Label of the browse panel's year row. */
119
+ archive: string;
120
+ /** Names a category filter among the active filters: "Category". */
121
+ category: string;
122
+ /** Names a keyword filter among the active filters: "Keyword". */
123
+ tag: string;
124
+ /** How many posts the active filters match: "{n} posts". */
125
+ postCount: string;
126
+ /** The same, for one post: "{n} post". */
127
+ postCountOne: string;
128
+ /** When no post matches the active filters. */
129
+ noMatches: string;
130
+ /** Accessible name of an active filter's remove link: "Remove filter: {filter}". */
131
+ removeFilter: string;
132
+ /** Link that clears every filter. */
117
133
  showAll: string;
118
- /** When no post has the keyword: "No posts tagged {tag}." */
119
- noTagged: string;
134
+ /** Button that shows the rest of a browse row: "+{n} more". */
135
+ more: string;
136
+ /** Button that shows a browse row's first values again. */
137
+ less: string;
138
+ /** Accessible name of the field that narrows a long browse row: "Filter {row}". */
139
+ filter: string;
140
+ /** When nothing in a browse row matches the filter field. */
141
+ noFilterMatches: string;
120
142
  previous: string;
121
143
  next: string;
122
144
  /** Accessible name of the page links. */
@@ -129,6 +151,8 @@ interface BlogLabels {
129
151
  declare const DEFAULT_LABELS: BlogLabels;
130
152
  type BlogScope = 'site' | 'section';
131
153
  type BlogLayout = 'list' | 'grid' | 'compact';
154
+ /** How a blog page groups its posts under headings: by year, by month, or not at all (`''`). */
155
+ type BlogGroupBy = 'year' | 'month' | '';
132
156
  interface BlogFeedConfig {
133
157
  title?: string;
134
158
  description?: string;
@@ -144,19 +168,33 @@ interface BlogIndexConfig {
144
168
  folders: string[];
145
169
  /** Only list posts with at least one of these tags. */
146
170
  tags: string[];
171
+ /** Only list posts in one of these categories. */
172
+ categories: string[];
147
173
  /** Most posts to list. `0` lists them all. */
148
174
  limit: number;
149
175
  layout: BlogLayout;
150
- /** Put a year heading above each year's posts. */
151
- groupByYear: boolean;
176
+ /** Put a heading above each year's or month's posts. */
177
+ groupBy: BlogGroupBy;
152
178
  /** Show the post's tags on each card. */
153
179
  showTags: boolean;
180
+ /** Show the post's category above its title on each card. */
181
+ showCategory: boolean;
182
+ /** List every category above the posts, each one a filter. */
183
+ categoryList: boolean;
184
+ /** Categories shown before "+N more", most used first. `0` shows them all. */
185
+ categoryLimit: number;
154
186
  /** List every keyword above the posts, each one a filter. */
155
187
  tagList: boolean;
188
+ /** Keywords shown before "+N more", most used first. `0` shows them all. */
189
+ tagLimit: number;
190
+ /** Leave keywords used by fewer posts than this out of the browse panel. They still show on cards. */
191
+ tagMinCount: number;
192
+ /** List the years and months that have posts above the posts, each one a filter. */
193
+ archive: boolean;
156
194
  /** Posts per page. `0` shows them all on one page. */
157
195
  pageSize: number;
158
- /** Most sticky posts pinned to the top. `0` pins them all. */
159
- stickyLimit: number;
196
+ /** Most pinned posts kept at the top. `0` pins them all. */
197
+ pinLimit: number;
160
198
  /** Show a "Subscribe" link to the blog's feed. */
161
199
  rssLink: boolean;
162
200
  feed: BlogFeedConfig | null;
@@ -184,7 +222,7 @@ interface BlogPostData {
184
222
  tags: string[];
185
223
  category: string;
186
224
  scope: BlogScope;
187
- sticky: boolean;
225
+ pinned: boolean;
188
226
  draft: boolean;
189
227
  /** Shown in the announcement banner above the nav bar. */
190
228
  announcement: boolean;
@@ -240,4 +278,4 @@ interface BlogAnnouncementData {
240
278
  */
241
279
  declare function blogMarkdown(md: MarkdownIt, options?: BlogOptions): void;
242
280
 
243
- export { type BlogAnnouncementData as B, DEFAULT_LABELS as D, type BlogAnnouncementItem as a, type BlogAuthor as b, type BlogFeedConfig as c, type BlogIndexConfig as d, type BlogLabels as e, type BlogLayout as f, type BlogOptions as g, type BlogPostData as h, type BlogScope as i, blogMarkdown as j };
281
+ export { type BlogAnnouncementData as B, DEFAULT_LABELS as D, type BlogAnnouncementItem as a, type BlogAuthor as b, type BlogFeedConfig as c, type BlogGroupBy as d, type BlogIndexConfig as e, type BlogLabels as f, type BlogLayout as g, type BlogOptions as h, type BlogPostData as i, type BlogScope as j, blogMarkdown as k };
@@ -64,10 +64,12 @@ interface BlogOptions {
64
64
  */
65
65
  pageSize?: number;
66
66
  /**
67
- * Most sticky posts pinned to the top of a blog page, for those that don't
68
- * set `stickyLimit`. Extra sticky posts take their place by date. `0` pins
69
- * them all. Default: `0`.
67
+ * Most `pinned: true` posts kept at the top of a blog page, for those that
68
+ * don't set `pinLimit`. Extra pinned posts take their place by date. `0`
69
+ * pins them all. Default: `0`.
70
70
  */
71
+ pinLimit?: number;
72
+ /** @deprecated Renamed `pinLimit`; still read when `pinLimit` isn't set. */
71
73
  stickyLimit?: number;
72
74
  /**
73
75
  * Show a "Subscribe" RSS link on blog pages and `::: blog-posts` blocks,
@@ -75,7 +77,7 @@ interface BlogOptions {
75
77
  * on a site with a site URL (without one, no feeds are written). Default: `true`.
76
78
  */
77
79
  rssLink?: boolean;
78
- /** Words the plugin writes on pages, for translating. `{n}`, `{blog}` and `{tag}` are filled in. */
80
+ /** Words the plugin writes on pages, for translating. `{n}`, `{blog}`, `{filter}` and `{row}` are filled in. */
79
81
  labels?: Partial<BlogLabels>;
80
82
  }
81
83
  interface BlogLabels {
@@ -94,29 +96,49 @@ interface BlogLabels {
94
96
  /** The link back to a post's blog: "All posts in {blog}". */
95
97
  allPosts: string;
96
98
  draft: string;
97
- /** Badge on a sticky post. */
98
- sticky: string;
99
+ /** Badge on a pinned post. */
100
+ pinned: string;
99
101
  /** Badge on an announcement, and the accessible name of the announcement banner. */
100
102
  announcement: string;
101
- /** Above a blog page filtered to announcements (`?announcements`). */
103
+ /** A blog page's announcements filter (`?announcements`), in the active filters. */
102
104
  announcements: string;
103
- /** When the blog page has no announcements to show. */
104
- noAnnouncements: string;
105
105
  /** Tooltip of the banner's count badge: "{n} announcements". */
106
106
  announcementCount: string;
107
107
  /** Accessible name of the banner's close button. */
108
108
  dismiss: string;
109
109
  noPosts: string;
110
- /** Year heading for posts without a date, when a blog groups by year. */
110
+ /** Group heading for posts without a date, when a blog groups by year or month. */
111
111
  undated: string;
112
- /** Label of a blog page's keyword list. */
112
+ /** Accessible name of the browse panel above a blog page's posts. */
113
+ browse: string;
114
+ /** Label of the browse panel's category row. */
115
+ categories: string;
116
+ /** Label of the browse panel's keyword row. */
113
117
  tags: string;
114
- /** Above a list filtered by keyword: "Posts tagged {tag}". */
115
- tagged: string;
116
- /** Link that clears the keyword filter. */
118
+ /** Label of the browse panel's year row. */
119
+ archive: string;
120
+ /** Names a category filter among the active filters: "Category". */
121
+ category: string;
122
+ /** Names a keyword filter among the active filters: "Keyword". */
123
+ tag: string;
124
+ /** How many posts the active filters match: "{n} posts". */
125
+ postCount: string;
126
+ /** The same, for one post: "{n} post". */
127
+ postCountOne: string;
128
+ /** When no post matches the active filters. */
129
+ noMatches: string;
130
+ /** Accessible name of an active filter's remove link: "Remove filter: {filter}". */
131
+ removeFilter: string;
132
+ /** Link that clears every filter. */
117
133
  showAll: string;
118
- /** When no post has the keyword: "No posts tagged {tag}." */
119
- noTagged: string;
134
+ /** Button that shows the rest of a browse row: "+{n} more". */
135
+ more: string;
136
+ /** Button that shows a browse row's first values again. */
137
+ less: string;
138
+ /** Accessible name of the field that narrows a long browse row: "Filter {row}". */
139
+ filter: string;
140
+ /** When nothing in a browse row matches the filter field. */
141
+ noFilterMatches: string;
120
142
  previous: string;
121
143
  next: string;
122
144
  /** Accessible name of the page links. */
@@ -129,6 +151,8 @@ interface BlogLabels {
129
151
  declare const DEFAULT_LABELS: BlogLabels;
130
152
  type BlogScope = 'site' | 'section';
131
153
  type BlogLayout = 'list' | 'grid' | 'compact';
154
+ /** How a blog page groups its posts under headings: by year, by month, or not at all (`''`). */
155
+ type BlogGroupBy = 'year' | 'month' | '';
132
156
  interface BlogFeedConfig {
133
157
  title?: string;
134
158
  description?: string;
@@ -144,19 +168,33 @@ interface BlogIndexConfig {
144
168
  folders: string[];
145
169
  /** Only list posts with at least one of these tags. */
146
170
  tags: string[];
171
+ /** Only list posts in one of these categories. */
172
+ categories: string[];
147
173
  /** Most posts to list. `0` lists them all. */
148
174
  limit: number;
149
175
  layout: BlogLayout;
150
- /** Put a year heading above each year's posts. */
151
- groupByYear: boolean;
176
+ /** Put a heading above each year's or month's posts. */
177
+ groupBy: BlogGroupBy;
152
178
  /** Show the post's tags on each card. */
153
179
  showTags: boolean;
180
+ /** Show the post's category above its title on each card. */
181
+ showCategory: boolean;
182
+ /** List every category above the posts, each one a filter. */
183
+ categoryList: boolean;
184
+ /** Categories shown before "+N more", most used first. `0` shows them all. */
185
+ categoryLimit: number;
154
186
  /** List every keyword above the posts, each one a filter. */
155
187
  tagList: boolean;
188
+ /** Keywords shown before "+N more", most used first. `0` shows them all. */
189
+ tagLimit: number;
190
+ /** Leave keywords used by fewer posts than this out of the browse panel. They still show on cards. */
191
+ tagMinCount: number;
192
+ /** List the years and months that have posts above the posts, each one a filter. */
193
+ archive: boolean;
156
194
  /** Posts per page. `0` shows them all on one page. */
157
195
  pageSize: number;
158
- /** Most sticky posts pinned to the top. `0` pins them all. */
159
- stickyLimit: number;
196
+ /** Most pinned posts kept at the top. `0` pins them all. */
197
+ pinLimit: number;
160
198
  /** Show a "Subscribe" link to the blog's feed. */
161
199
  rssLink: boolean;
162
200
  feed: BlogFeedConfig | null;
@@ -184,7 +222,7 @@ interface BlogPostData {
184
222
  tags: string[];
185
223
  category: string;
186
224
  scope: BlogScope;
187
- sticky: boolean;
225
+ pinned: boolean;
188
226
  draft: boolean;
189
227
  /** Shown in the announcement banner above the nav bar. */
190
228
  announcement: boolean;
@@ -240,4 +278,4 @@ interface BlogAnnouncementData {
240
278
  */
241
279
  declare function blogMarkdown(md: MarkdownIt, options?: BlogOptions): void;
242
280
 
243
- export { type BlogAnnouncementData as B, DEFAULT_LABELS as D, type BlogAnnouncementItem as a, type BlogAuthor as b, type BlogFeedConfig as c, type BlogIndexConfig as d, type BlogLabels as e, type BlogLayout as f, type BlogOptions as g, type BlogPostData as h, type BlogScope as i, blogMarkdown as j };
281
+ export { type BlogAnnouncementData as B, DEFAULT_LABELS as D, type BlogAnnouncementItem as a, type BlogAuthor as b, type BlogFeedConfig as c, type BlogGroupBy as d, type BlogIndexConfig as e, type BlogLabels as f, type BlogLayout as g, type BlogOptions as h, type BlogPostData as i, type BlogScope as j, blogMarkdown as k };