astro-accelerator-utils 0.3.64 → 0.3.65

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.
@@ -62,5 +62,12 @@ export function hasModDate(p: MarkdownInstance): boolean;
62
62
  * @returns {boolean}
63
63
  */
64
64
  export function isListable(p: MarkdownInstance<Record<string, any>>): boolean;
65
+ /**
66
+ * Predicate for whether a page should be used to create tag and category lists.
67
+ * Specifically, this allows future-dated posts to cause taxonomy pages to be created,
68
+ * @param {MarkdownInstance<Record<string, any>>} p
69
+ * @returns {boolean}
70
+ */
71
+ export function forTaxonomy(p: MarkdownInstance<Record<string, any>>): boolean;
65
72
  export type PagePredicate = import("../types/PagePredicate").PagePredicate;
66
73
  export type MarkdownInstance = import("../types/Astro").MarkdownInstance;
@@ -147,5 +147,35 @@ export function isListable (p) {
147
147
  return false;
148
148
  }
149
149
 
150
+ return true;
151
+ }
152
+
153
+ /**
154
+ * Predicate for whether a page should be used to create tag and category lists.
155
+ * Specifically, this allows future-dated posts to cause taxonomy pages to be created,
156
+ * @param {MarkdownInstance<Record<string, any>>} p
157
+ * @returns {boolean}
158
+ */
159
+ export function forTaxonomy (p) {
160
+ if (p.url == null || p.url === '') {
161
+ return false;
162
+ }
163
+
164
+ if (p.frontmatter == null || p.frontmatter.layout == null) {
165
+ return false;
166
+ }
167
+
168
+ if (p.frontmatter.layout.includes('/Redirect.astro')) {
169
+ return false;
170
+ }
171
+
172
+ if (p.frontmatter.listable != null && p.frontmatter.listable == false) {
173
+ return false;
174
+ }
175
+
176
+ if (p.frontmatter.draft == true) {
177
+ return false;
178
+ }
179
+
150
180
  return true;
151
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-accelerator-utils",
3
- "version": "0.3.64",
3
+ "version": "0.3.65",
4
4
  "description": "Astro utilities for Astro Accelerator.",
5
5
  "main": "index.mjs",
6
6
  "type": "module",