astro-accelerator-utils 0.3.31 → 0.3.33
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/lib/postFiltering.d.mts +6 -0
- package/lib/postFiltering.mjs +14 -0
- package/lib/v1/cache.mjs +0 -1
- package/package.json +1 -1
package/lib/postFiltering.d.mts
CHANGED
|
@@ -26,6 +26,12 @@ export function showInMenu(p: MarkdownInstance): boolean;
|
|
|
26
26
|
* @returns {boolean}
|
|
27
27
|
*/
|
|
28
28
|
export function isAuthor(p: MarkdownInstance): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Predicate for whether a page is an author page
|
|
31
|
+
* @param {MarkdownInstance} p
|
|
32
|
+
* @returns {boolean}
|
|
33
|
+
*/
|
|
34
|
+
export function notAuthor(p: MarkdownInstance): boolean;
|
|
29
35
|
/**
|
|
30
36
|
* Predicate for whether a page is a search page
|
|
31
37
|
* @param {MarkdownInstance} p
|
package/lib/postFiltering.mjs
CHANGED
|
@@ -60,6 +60,20 @@ export function isAuthor (p) {
|
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Predicate for whether a page is an author page
|
|
65
|
+
* @param {MarkdownInstance} p
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
export function notAuthor (p) {
|
|
69
|
+
if (p?.frontmatter?.layout?.indexOf('/Author.astro') < 0) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
63
77
|
/**
|
|
64
78
|
* Predicate for whether a page is a search page
|
|
65
79
|
* @param {MarkdownInstance} p
|
package/lib/v1/cache.mjs
CHANGED
|
@@ -44,7 +44,6 @@ export class Cache {
|
|
|
44
44
|
var date_time = new Date();
|
|
45
45
|
let timeDifference = Math.abs((date_time.getTime() - mtime.getTime()) / 1000);
|
|
46
46
|
if (timeDifference < this.maxAge) {
|
|
47
|
-
console.log('Cache hit', key);
|
|
48
47
|
const content = fs.readFileSync(itemPath).toString();
|
|
49
48
|
return JSON.parse(content);
|
|
50
49
|
}
|