astro-accelerator-utils 0.0.41 → 0.0.42

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 };
13
+ export { PostQueries, PostFiltering, PostOrdering, PostPaging, Cache, Config, Dates, FooterMenu, Markdown, Navigation, Taxonomy, Urls, Language };
package/index.mjs CHANGED
@@ -11,6 +11,8 @@ 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
+
14
16
  export {
15
17
  PostQueries,
16
18
  PostFiltering,
@@ -23,5 +25,6 @@ export {
23
25
  Markdown,
24
26
  Navigation,
25
27
  Taxonomy,
26
- Urls
28
+ Urls,
29
+ Language
27
30
  };
@@ -0,0 +1,114 @@
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
+ }
package/lib/config.d.mts CHANGED
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * @typedef { import("../types/Site").Site } Site
3
3
  */
4
- /** @type {Site} */
5
- export const SITE: Site;
4
+ /**
5
+ * Gets default configuration
6
+ * @returns {Site}
7
+ */
8
+ export function getDefault(): Site;
6
9
  export type Site = import("../types/Site").Site;
package/lib/config.mjs CHANGED
@@ -2,43 +2,48 @@
2
2
  * @typedef { import("../types/Site").Site } Site
3
3
  */
4
4
 
5
- /** @type {Site} */
6
- export const SITE = {
7
- owner: '',
8
- url: '',
9
- feedUrl: '',
10
- title: '',
11
- description: '',
12
- themeColor: '#222255',
13
- subfolder: '',
14
- defaultLanguage: 'en',
15
- default: {
16
- lang: 'en',
17
- locale: 'en-US',
18
- dir: 'ltr'
19
- },
20
- search: {
21
- fallbackUrl: 'https://www.google.com/search',
22
- fallbackSite: 'q',
23
- fallbackQuery: 'q',
24
- },
25
- pageSize: 12,
26
- pageLinks: 3,
27
- rssLimit: 20,
28
- dateOptions: {
29
- weekday: 'long',
30
- year: 'numeric',
31
- month: 'long',
32
- day: 'numeric',
33
- },
34
- featureFlags: {
35
- codeBlocks: ['copy'],
36
- figures: ['enlarge'],
37
- youTubeLinks: ['embed'],
38
- },
39
- images: {
40
- contentSize: '(max-width: 860px) 100vw, 620px',
41
- listerSize: '(max-width: 860px) 90vw, 350px',
42
- authorSize: '50px',
43
- }
44
- };
5
+ /**
6
+ * Gets default configuration
7
+ * @returns {Site}
8
+ */
9
+ export function getDefault() {
10
+ return {
11
+ owner: '',
12
+ url: '',
13
+ feedUrl: '',
14
+ title: '',
15
+ description: '',
16
+ themeColor: '#222255',
17
+ subfolder: '',
18
+ defaultLanguage: 'en',
19
+ default: {
20
+ lang: 'en',
21
+ locale: 'en-US',
22
+ dir: 'ltr'
23
+ },
24
+ search: {
25
+ fallbackUrl: 'https://www.google.com/search',
26
+ fallbackSite: 'q',
27
+ fallbackQuery: 'q',
28
+ },
29
+ pageSize: 12,
30
+ pageLinks: 3,
31
+ rssLimit: 20,
32
+ dateOptions: {
33
+ weekday: 'long',
34
+ year: 'numeric',
35
+ month: 'long',
36
+ day: 'numeric',
37
+ },
38
+ featureFlags: {
39
+ codeBlocks: ['copy'],
40
+ figures: ['enlarge'],
41
+ youTubeLinks: ['embed'],
42
+ },
43
+ images: {
44
+ contentSize: '(max-width: 860px) 100vw, 620px',
45
+ listerSize: '(max-width: 860px) 90vw, 350px',
46
+ authorSize: '50px',
47
+ }
48
+ };
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-accelerator-utils",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "Astro utilities for Astro Accelerator.",
5
5
  "main": "index.mjs",
6
6
  "files": [