astro-accelerator-utils 0.0.42 → 0.0.44

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/index.d.mts CHANGED
@@ -10,4 +10,4 @@ import * as Markdown from "./lib/markdown.mjs";
10
10
  import * as Navigation from "./lib/navigation.mjs";
11
11
  import * as Taxonomy from "./lib/taxonomy.mjs";
12
12
  import * as Urls from "./lib/urls.mjs";
13
- export { PostQueries, PostFiltering, PostOrdering, PostPaging, Cache, Config, Dates, FooterMenu, Markdown, Navigation, Taxonomy, Urls, Language };
13
+ export { PostQueries, PostFiltering, PostOrdering, PostPaging, Cache, Config, Dates, FooterMenu, Markdown, Navigation, Taxonomy, Urls };
package/index.mjs CHANGED
@@ -11,8 +11,6 @@ import * as Navigation from './lib/navigation.mjs';
11
11
  import * as Taxonomy from './lib/taxonomy.mjs';
12
12
  import * as Urls from './lib/urls.mjs';
13
13
 
14
- import * as Language from './lib/_language.json';
15
-
16
14
  export {
17
15
  PostQueries,
18
16
  PostFiltering,
@@ -25,6 +23,5 @@ export {
25
23
  Markdown,
26
24
  Navigation,
27
25
  Taxonomy,
28
- Urls,
29
- Language
26
+ Urls
30
27
  };
@@ -79,8 +79,21 @@ export function isSearch (p) {
79
79
  * @returns {boolean}
80
80
  */
81
81
  export function isListable (p) {
82
- return p.url != null
83
- && p.url != ''
84
- && p.frontmatter.layout.includes('/Redirect.astro') !== true
85
- && Date.parse(p.frontmatter.pubDate) < Date.now()
82
+ if (p.url == null || p.url === '') {
83
+ return false;
84
+ }
85
+
86
+ if (p.frontmatter.layout.includes('/Redirect.astro')) {
87
+ return false;
88
+ }
89
+
90
+ if (p.frontmatter.draft == true) {
91
+ return false;
92
+ }
93
+
94
+ if (Date.parse(p.frontmatter.pubDate) > Date.now()) {
95
+ return false;
96
+ }
97
+
98
+ return true;
86
99
  }
package/lib/taxonomy.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as Urls from './urls.mjs';
2
2
  import * as Cache from './cache.mjs';
3
3
  import * as PostQueries from './postQueries.mjs';
4
+ import * as PostFiltering from './postFiltering.mjs';
4
5
 
5
6
  /**
6
7
  * @typedef { import("../types/Taxonomy").Taxonomy } Taxonomy
@@ -65,7 +66,7 @@ export async function getTaxonomy () {
65
66
 
66
67
  if (taxonomy == null) {
67
68
  /** @type {MarkdownInstance[]} */
68
- const allPages = await PostQueries.getPages();
69
+ const allPages = await PostQueries.getPages(PostFiltering.isListable);
69
70
 
70
71
  /** @type {{ [key: string]: number }} */
71
72
  const tags = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-accelerator-utils",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "Astro utilities for Astro Accelerator.",
5
5
  "main": "index.mjs",
6
6
  "files": [
@@ -1,114 +0,0 @@
1
- {
2
- "aria": {
3
- "breadcrumbs": {
4
- "en": "Breadcrumb"
5
- },
6
- "site_navigation": {
7
- "en": "Site Navigation"
8
- },
9
- "toc": {
10
- "en": "Table of contents"
11
- },
12
- "paging": {
13
- "en": "Paging"
14
- },
15
- "skiplinks": {
16
- "en": "Skip Links"
17
- },
18
- "back_to_top": {
19
- "en": "Skip Back"
20
- }
21
- },
22
- "skiplinks": {
23
- "skip_to_top": {
24
- "en": "Back to top"
25
- },
26
- "skip_to_navigation": {
27
- "en": "Skip to navigation"
28
- },
29
- "skip_to_content": {
30
- "en": "Skip to main content"
31
- },
32
- "skip_to_footer": {
33
- "en": "Skip to footer"
34
- }
35
- },
36
- "header": {
37
- "open_menu": {
38
- "en": "Open menu"
39
- },
40
- "open_search": {
41
- "en": "Open site search"
42
- }
43
- },
44
- "navigation": {
45
- "title": {
46
- "en": "Navigation"
47
- }
48
- },
49
- "toc": {
50
- "title":{
51
- "en": "Table of contents"
52
- }
53
- },
54
- "footer": {
55
- "copyright": {
56
- "en": "Copyright"
57
- }
58
- },
59
- "post": {
60
- "written_by": {
61
- "en": "Written by"
62
- },
63
- "last_modified": {
64
- "en": "Revised"
65
- }
66
- },
67
- "author": {
68
- "recent_articles": {
69
- "en": "Recent Articles"
70
- },
71
- "twitter": {
72
- "en": "Twitter"
73
- }
74
- },
75
- "search": {
76
- "search_for": {
77
- "en": "Search for"
78
- },
79
- "submit": {
80
- "en": "Go"
81
- },
82
- "results_title": {
83
- "en": "Results"
84
- },
85
- "no_results_title": {
86
- "en": "No Results"
87
- }
88
- },
89
- "articles": {
90
- "page_title": {
91
- "en": "Page {n}"
92
- },
93
- "previous": {
94
- "en": "Prev"
95
- },
96
- "next": {
97
- "en": "Next"
98
- },
99
- "category_title": {
100
- "en": "Categories"
101
- },
102
- "tag_title": {
103
- "en": "Tags"
104
- },
105
- "category": {
106
- "_note": "This must match your URL path to category pages, as in /category/example/1/",
107
- "en": "category"
108
- },
109
- "tag": {
110
- "_note": "This must match your URL path to tag pages, as in /tag/example/1/",
111
- "en": "tag"
112
- }
113
- }
114
- }