astro-accelerator-utils 0.2.0 → 0.2.2
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 +0 -1
- package/lib/v1/{_factory.mjs → accelerator.mjs} +13 -11
- package/package.json +1 -1
- package/lib/v1/_factory.d.mts +0 -29
- package/lib/v1/authors.d.mts +0 -28
- package/lib/v1/cache.d.mts +0 -43
- package/lib/v1/dates.d.mts +0 -19
- package/lib/v1/markdown.d.mts +0 -20
- package/lib/v1/navigation.d.mts +0 -110
- package/lib/v1/paging.d.mts +0 -15
- package/lib/v1/posts.d.mts +0 -26
- package/lib/v1/taxonomy.d.mts +0 -62
- package/lib/v1/urls.d.mts +0 -20
- package/types/AuthorList.d.ts +0 -8
- package/types/BannerImage.d.ts +0 -4
- package/types/NavPage.d.ts +0 -10
- package/types/Site.d.ts +0 -35
- package/types/Taxonomy.d.ts +0 -15
package/index.d.mts
CHANGED
|
@@ -8,16 +8,18 @@ import { Posts } from './posts.mjs';
|
|
|
8
8
|
import { Taxonomy } from './taxonomy.mjs';
|
|
9
9
|
import { UrlFormatter } from './urls.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @typedef { import("../../types/Site").Site } Site
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export class Accelerator {
|
|
12
16
|
/**
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {Intl.DateTimeFormatOptions} dateOptions
|
|
15
|
-
* @param {string} siteUrl
|
|
17
|
+
* @param {Site} site
|
|
16
18
|
*/
|
|
17
|
-
constructor(
|
|
18
|
-
this.cacheMaxAge = cacheMaxAge;
|
|
19
|
-
this.dateOptions = dateOptions;
|
|
20
|
-
this.siteUrl = siteUrl;
|
|
19
|
+
constructor(site) {
|
|
20
|
+
this.cacheMaxAge = site.cacheMaxAge;
|
|
21
|
+
this.dateOptions = site.dateOptions;
|
|
22
|
+
this.siteUrl = site.siteUrl;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
get authors() {
|
|
@@ -25,11 +27,11 @@ export class Factory {
|
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
get cache() {
|
|
28
|
-
return new Cache(this.cacheMaxAge);
|
|
30
|
+
return new Cache(this.site.cacheMaxAge);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
get dateFormatter() {
|
|
32
|
-
return new DateFormatter(this.dateOptions)
|
|
34
|
+
return new DateFormatter(this.site.dateOptions)
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
get markdown() {
|
|
@@ -53,6 +55,6 @@ export class Factory {
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
get urlFormatter() {
|
|
56
|
-
return new UrlFormatter(this.siteUrl)
|
|
58
|
+
return new UrlFormatter(this.site.siteUrl)
|
|
57
59
|
}
|
|
58
60
|
}
|
package/package.json
CHANGED
package/lib/v1/_factory.d.mts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export class Factory {
|
|
2
|
-
/**
|
|
3
|
-
* @param {number} cacheMaxAge
|
|
4
|
-
* @param {Intl.DateTimeFormatOptions} dateOptions
|
|
5
|
-
* @param {string} siteUrl
|
|
6
|
-
*/
|
|
7
|
-
constructor(cacheMaxAge: number, dateOptions: Intl.DateTimeFormatOptions, siteUrl: string);
|
|
8
|
-
cacheMaxAge: number;
|
|
9
|
-
dateOptions: Intl.DateTimeFormatOptions;
|
|
10
|
-
siteUrl: string;
|
|
11
|
-
get authors(): Authors;
|
|
12
|
-
get cache(): Cache;
|
|
13
|
-
get dateFormatter(): DateFormatter;
|
|
14
|
-
get markdown(): Markdown;
|
|
15
|
-
get navigation(): Navigation;
|
|
16
|
-
get paging(): Paging;
|
|
17
|
-
get posts(): Posts;
|
|
18
|
-
get taxonomy(): Taxonomy;
|
|
19
|
-
get urlFormatter(): UrlFormatter;
|
|
20
|
-
}
|
|
21
|
-
import { Authors } from "./authors.mjs";
|
|
22
|
-
import { Cache } from "./cache.mjs";
|
|
23
|
-
import { DateFormatter } from "./dates.mjs";
|
|
24
|
-
import { Markdown } from "./markdown.mjs";
|
|
25
|
-
import { Navigation } from "./navigation.mjs";
|
|
26
|
-
import { Paging } from "./paging.mjs";
|
|
27
|
-
import { Posts } from "./posts.mjs";
|
|
28
|
-
import { Taxonomy } from "./taxonomy.mjs";
|
|
29
|
-
import { UrlFormatter } from "./urls.mjs";
|
package/lib/v1/authors.d.mts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("../../types/AuthorList").AuthorList } AuthorList
|
|
3
|
-
* @typedef { import("../../types/Astro").MarkdownInstance } MarkdownInstance
|
|
4
|
-
* @typedef { import("../../types/Frontmatter").Frontmatter } Frontmatter
|
|
5
|
-
*/
|
|
6
|
-
export class Authors {
|
|
7
|
-
/**
|
|
8
|
-
* Constructor
|
|
9
|
-
* @param {Posts} posts
|
|
10
|
-
*/
|
|
11
|
-
constructor(posts: Posts);
|
|
12
|
-
posts: Posts;
|
|
13
|
-
/**
|
|
14
|
-
* Gets a list of authors, and exposes main author and contributors
|
|
15
|
-
* @param {Frontmatter} frontmatter
|
|
16
|
-
* @returns {AuthorList}
|
|
17
|
-
*/
|
|
18
|
-
forPost(frontmatter: Frontmatter): AuthorList;
|
|
19
|
-
/**
|
|
20
|
-
* Get a single author by id/slug
|
|
21
|
-
* @param {string} slug
|
|
22
|
-
* @returns {MarkdownInstance}
|
|
23
|
-
*/
|
|
24
|
-
info(slug: string): MarkdownInstance;
|
|
25
|
-
}
|
|
26
|
-
export type AuthorList = import("../../types/AuthorList").AuthorList;
|
|
27
|
-
export type MarkdownInstance = import("../../types/Astro").MarkdownInstance;
|
|
28
|
-
export type Frontmatter = import("../../types/Frontmatter").Frontmatter;
|
package/lib/v1/cache.d.mts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export class Cache {
|
|
2
|
-
/**
|
|
3
|
-
* Constructor
|
|
4
|
-
* @param {number} maxAge
|
|
5
|
-
*/
|
|
6
|
-
constructor(maxAge: number);
|
|
7
|
-
maxAge: number;
|
|
8
|
-
/**
|
|
9
|
-
* Gets an item from the cache, falls back to supplied function
|
|
10
|
-
* @param {string} key
|
|
11
|
-
* @param {() => any} func
|
|
12
|
-
*/
|
|
13
|
-
get(key: string, func: () => any): any;
|
|
14
|
-
/**
|
|
15
|
-
* Gets an item from the cache
|
|
16
|
-
* @param {string} key
|
|
17
|
-
* @returns {Promise<any>}
|
|
18
|
-
*/
|
|
19
|
-
getItem(key: string): Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* Adds an item to the cache
|
|
22
|
-
* @param {string} key
|
|
23
|
-
* @param {any} value
|
|
24
|
-
* @returns {Promise<void>}
|
|
25
|
-
*/
|
|
26
|
-
setItem(key: string, value: any): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Clears the cache
|
|
29
|
-
* @returns {Promise<void>}
|
|
30
|
-
*/
|
|
31
|
-
clear(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Get's the path of the cache files
|
|
34
|
-
* @returns {string}
|
|
35
|
-
*/
|
|
36
|
-
getCachePath(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Gets the file path for a cache item
|
|
39
|
-
* @param {string} key
|
|
40
|
-
* @returns {string}
|
|
41
|
-
*/
|
|
42
|
-
getItemPath(key: string): string;
|
|
43
|
-
}
|
package/lib/v1/dates.d.mts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("../types/Site") } Site
|
|
3
|
-
*/
|
|
4
|
-
export class DateFormatter {
|
|
5
|
-
/**
|
|
6
|
-
* Constructor
|
|
7
|
-
* @param {Intl.DateTimeFormatOptions} dateOptions
|
|
8
|
-
*/
|
|
9
|
-
constructor(dateOptions: Intl.DateTimeFormatOptions);
|
|
10
|
-
dateOptions: Intl.DateTimeFormatOptions;
|
|
11
|
-
/**
|
|
12
|
-
* Returns the formatted pubDate
|
|
13
|
-
* @param {string | Date} date
|
|
14
|
-
* @param {string} lang
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
formatDate(date: string | Date, lang: string): string;
|
|
18
|
-
}
|
|
19
|
-
export type Site = any;
|
package/lib/v1/markdown.d.mts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export class Markdown {
|
|
2
|
-
/**
|
|
3
|
-
* Converts markdown to HTML without wrapping in a <p>
|
|
4
|
-
* @param {string} markdown
|
|
5
|
-
* @returns {Promise<string>}
|
|
6
|
-
*/
|
|
7
|
-
getInlineHtmlFrom(markdown: string): Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Converts markdown to HTML
|
|
10
|
-
* @param {string} markdown
|
|
11
|
-
* @returns {Promise<string>}
|
|
12
|
-
*/
|
|
13
|
-
getHtmlFrom(markdown: string): Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Converts markdown to plain text
|
|
16
|
-
* @param {string} markdown
|
|
17
|
-
* @returns {Promise<string>}
|
|
18
|
-
*/
|
|
19
|
-
getTextFrom(markdown: string): Promise<string>;
|
|
20
|
-
}
|
package/lib/v1/navigation.d.mts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("./posts.mjs").Posts } Posts
|
|
3
|
-
* @typedef { import("./taxonomy.mjs").Taxonomy } Taxonomy
|
|
4
|
-
* @typedef { import("./urls.mjs").UrlFormatter } UrlFormatter
|
|
5
|
-
* @typedef { import("../../types/Astro").MarkdownInstance } MarkdownInstance
|
|
6
|
-
* @typedef { import("../../types/NavPage").NavPage } NavPage
|
|
7
|
-
*/
|
|
8
|
-
export class Navigation {
|
|
9
|
-
/**
|
|
10
|
-
* Constructor
|
|
11
|
-
* @param {Posts} posts
|
|
12
|
-
* @param {UrlFormatter} urlFormatter
|
|
13
|
-
* @param {Taxonomy} taxonomy
|
|
14
|
-
*/
|
|
15
|
-
constructor(posts: Posts, urlFormatter: UrlFormatter, taxonomy: Taxonomy);
|
|
16
|
-
posts: import("./posts.mjs").Posts;
|
|
17
|
-
urlFormatter: import("./urls.mjs").UrlFormatter;
|
|
18
|
-
taxonomy: import("./taxonomy.mjs").Taxonomy;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a list of breadcrumbs
|
|
21
|
-
* @param {URL} currentUrl
|
|
22
|
-
* @param {string} subfolder
|
|
23
|
-
* @returns {NavPage[]}
|
|
24
|
-
*/
|
|
25
|
-
breadcrumbs(currentUrl: URL, subfolder: string): NavPage[];
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {URL} currentUrl
|
|
29
|
-
* @param {string} subfolder
|
|
30
|
-
* @param {(NavPage | 'auto')[]} menu
|
|
31
|
-
* @returns {NavPage[]}
|
|
32
|
-
*/
|
|
33
|
-
menu(currentUrl: URL, subfolder: string, menu: (NavPage | 'auto')[]): NavPage[];
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @param {string} subfolder
|
|
37
|
-
* @returns {NavPage[]}
|
|
38
|
-
*/
|
|
39
|
-
autoMenu(subfolder: string): NavPage[];
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {URL} currentUrl
|
|
43
|
-
* @param {TranslationProvider} _
|
|
44
|
-
* @param {any} translations
|
|
45
|
-
* @param {string} subfolder
|
|
46
|
-
* @param {(NavPage | 'categories' | 'tags' | 'toptags')[]} menu
|
|
47
|
-
* @returns {NavPage[]}
|
|
48
|
-
*/
|
|
49
|
-
footer(currentUrl: URL, _: TranslationProvider, translations: any, subfolder: string, menu: (NavPage | 'categories' | 'tags' | 'toptags')[]): NavPage[];
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @param {TaxonomyLinks} links
|
|
53
|
-
* @param {TranslationProvider} _
|
|
54
|
-
* @param {any} translations
|
|
55
|
-
* @param {string} subfolder
|
|
56
|
-
* @param {TaxonomyList} entries
|
|
57
|
-
* @returns {NavPage[]}
|
|
58
|
-
*/
|
|
59
|
-
getCategories(links: TaxonomyLinks, _: TranslationProvider, translations: any, subfolder: string, entries: TaxonomyList): NavPage[];
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param {TaxonomyLinks} links
|
|
63
|
-
* @param {TranslationProvider} _
|
|
64
|
-
* @param {any} translations
|
|
65
|
-
* @param {string} subfolder
|
|
66
|
-
* @param {TaxonomyList} entries
|
|
67
|
-
* @returns {NavPage[]}
|
|
68
|
-
*/
|
|
69
|
-
getTags(links: TaxonomyLinks, _: TranslationProvider, translations: any, subfolder: string, entries: TaxonomyList): NavPage[];
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @param {TaxonomyLinks} links
|
|
73
|
-
* @param {TranslationProvider} _
|
|
74
|
-
* @param {any} translations
|
|
75
|
-
* @param {string} subfolder
|
|
76
|
-
* @param {TaxonomyList} entries
|
|
77
|
-
* @returns {NavPage[]}
|
|
78
|
-
*/
|
|
79
|
-
getTopTags(links: TaxonomyLinks, _: TranslationProvider, translations: any, subfolder: string, entries: TaxonomyList): NavPage[];
|
|
80
|
-
/**
|
|
81
|
-
* Walks a NavPage tree to set current page
|
|
82
|
-
* @param {NavPage[]} pages
|
|
83
|
-
* @param {URL} currentUrl
|
|
84
|
-
*/
|
|
85
|
-
setCurrentPage(pages: NavPage[], currentUrl: URL): void;
|
|
86
|
-
/**
|
|
87
|
-
* Converts a MarkdownInstance into a NavPage
|
|
88
|
-
* @param {MarkdownInstance} page
|
|
89
|
-
* @returns {NavPage}
|
|
90
|
-
*/
|
|
91
|
-
mapNavPage(page: MarkdownInstance): NavPage;
|
|
92
|
-
/**
|
|
93
|
-
* Checks whether the item is a NavPage
|
|
94
|
-
* @param {NavPage | 'auto' | 'tags' | 'toptags' | 'categories'} item
|
|
95
|
-
* @returns {item is NavPage}
|
|
96
|
-
*/
|
|
97
|
-
isNavPage(item: NavPage | 'auto' | 'tags' | 'toptags' | 'categories'): item is import("../../types/NavPage").NavPage;
|
|
98
|
-
/**
|
|
99
|
-
* Pops matching page from array
|
|
100
|
-
* @param {MarkdownInstance[]} allPages
|
|
101
|
-
* @param {string} search
|
|
102
|
-
* @returns
|
|
103
|
-
*/
|
|
104
|
-
popMatchingPage(allPages: MarkdownInstance[], search: string): import("../../types/Astro").MarkdownInstance;
|
|
105
|
-
}
|
|
106
|
-
export type Posts = import("./posts.mjs").Posts;
|
|
107
|
-
export type Taxonomy = import("./taxonomy.mjs").Taxonomy;
|
|
108
|
-
export type UrlFormatter = import("./urls.mjs").UrlFormatter;
|
|
109
|
-
export type MarkdownInstance = import("../../types/Astro").MarkdownInstance;
|
|
110
|
-
export type NavPage = import("../../types/NavPage").NavPage;
|
package/lib/v1/paging.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("../types/Link").Link } Link
|
|
3
|
-
*/
|
|
4
|
-
export class Paging {
|
|
5
|
-
/**
|
|
6
|
-
* Provides a list of paging links, 1 ... 3 4 5 ... 7
|
|
7
|
-
* @param {number} limit
|
|
8
|
-
* @param {number} numberOfPages
|
|
9
|
-
* @param {number} currentPage
|
|
10
|
-
* @param {string} url
|
|
11
|
-
* @returns {Link[]}
|
|
12
|
-
*/
|
|
13
|
-
links(limit: number, numberOfPages: number, currentPage: number, url: string): Link[];
|
|
14
|
-
}
|
|
15
|
-
export type Link = any;
|
package/lib/v1/posts.d.mts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("../../types/Astro").MarkdownInstance } MarkdownInstance
|
|
3
|
-
* @typedef { import("./cache.mjs").Cache } Cache
|
|
4
|
-
*/
|
|
5
|
-
export class Posts {
|
|
6
|
-
/**
|
|
7
|
-
* Constructor
|
|
8
|
-
* @param {Cache} cache
|
|
9
|
-
* @param {() => MarkdownInstance[]} [fetchAll]
|
|
10
|
-
*/
|
|
11
|
-
constructor(cache: Cache, fetchAll?: () => MarkdownInstance[]);
|
|
12
|
-
cache: import("./cache.mjs").Cache;
|
|
13
|
-
fetchAll: () => any;
|
|
14
|
-
/**
|
|
15
|
-
* Gets all markdown posts in the site
|
|
16
|
-
* @returns {MarkdownInstance[]}
|
|
17
|
-
*/
|
|
18
|
-
all(): MarkdownInstance[];
|
|
19
|
-
/**
|
|
20
|
-
* Gets top-level markdown posts in the site
|
|
21
|
-
* @returns {MarkdownInstance[]}
|
|
22
|
-
*/
|
|
23
|
-
root(subfolder: any): MarkdownInstance[];
|
|
24
|
-
}
|
|
25
|
-
export type MarkdownInstance = import("../../types/Astro").MarkdownInstance;
|
|
26
|
-
export type Cache = import("./cache.mjs").Cache;
|
package/lib/v1/taxonomy.d.mts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { import("./cache.mjs").Cache } Cache
|
|
3
|
-
* @typedef { import("./posts.mjs").Posts } Posts
|
|
4
|
-
* @typedef { import("./urls.mjs").UrlFormatter } UrlFormatter
|
|
5
|
-
* @typedef { import("../../types/Site").Site } Site
|
|
6
|
-
* @typedef { import("../../types/Taxonomy").TaxonomyList } TaxonomyList
|
|
7
|
-
* @typedef { import("../../types/Taxonomy").TaxonomyEntry } TaxonomyEntry
|
|
8
|
-
* @typedef { import("../../types/Taxonomy").TaxonomyLinks } TaxonomyLinks
|
|
9
|
-
* @typedef { import("../../types/Astro").MarkdownInstance } MarkdownInstance
|
|
10
|
-
*/
|
|
11
|
-
export class Taxonomy {
|
|
12
|
-
/**
|
|
13
|
-
* Constructor
|
|
14
|
-
* @param {Cache} cache
|
|
15
|
-
* @param {Posts} posts
|
|
16
|
-
* @param {UrlFormatter} urlFormatter
|
|
17
|
-
*/
|
|
18
|
-
constructor(cache: Cache, posts: Posts, urlFormatter: UrlFormatter);
|
|
19
|
-
cache: import("./cache.mjs").Cache;
|
|
20
|
-
posts: import("./posts.mjs").Posts;
|
|
21
|
-
urlFormatter: import("./urls.mjs").UrlFormatter;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @returns {TaxonomyList}
|
|
25
|
-
*/
|
|
26
|
-
all(): TaxonomyList;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param {any} translations
|
|
30
|
-
* @param {(entry: any) => string} lang
|
|
31
|
-
* @param {string} subfolder
|
|
32
|
-
* @returns {TaxonomyLinks}
|
|
33
|
-
*/
|
|
34
|
-
links(translations: any, lang: (entry: any) => string, subfolder: string): TaxonomyLinks;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @returns {TaxonomyList}
|
|
38
|
-
*/
|
|
39
|
-
getTaxonomy(): TaxonomyList;
|
|
40
|
-
/**
|
|
41
|
-
* Sorts taxonomy entries by title
|
|
42
|
-
* @param {TaxonomyEntry} a
|
|
43
|
-
* @param {TaxonomyEntry} b
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
sortByTitle(a: TaxonomyEntry, b: TaxonomyEntry): 0 | 1 | -1;
|
|
47
|
-
/**
|
|
48
|
-
* Sorts taxonomy entries by title
|
|
49
|
-
* @param {TaxonomyEntry} a
|
|
50
|
-
* @param {TaxonomyEntry} b
|
|
51
|
-
* @returns
|
|
52
|
-
*/
|
|
53
|
-
sortByVolume(a: TaxonomyEntry, b: TaxonomyEntry): number;
|
|
54
|
-
}
|
|
55
|
-
export type Cache = import("./cache.mjs").Cache;
|
|
56
|
-
export type Posts = import("./posts.mjs").Posts;
|
|
57
|
-
export type UrlFormatter = import("./urls.mjs").UrlFormatter;
|
|
58
|
-
export type Site = import("../../types/Site").Site;
|
|
59
|
-
export type TaxonomyList = import("../../types/Taxonomy").TaxonomyList;
|
|
60
|
-
export type TaxonomyEntry = import("../../types/Taxonomy").TaxonomyEntry;
|
|
61
|
-
export type TaxonomyLinks = import("../../types/Taxonomy").TaxonomyLinks;
|
|
62
|
-
export type MarkdownInstance = import("../../types/Astro").MarkdownInstance;
|
package/lib/v1/urls.d.mts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export class UrlFormatter {
|
|
2
|
-
/**
|
|
3
|
-
* Constructor
|
|
4
|
-
* @param {string} siteUrl
|
|
5
|
-
*/
|
|
6
|
-
constructor(siteUrl: string);
|
|
7
|
-
siteUrl: string;
|
|
8
|
-
/**
|
|
9
|
-
* Ensures trailing slash is used
|
|
10
|
-
* @param {URL} url
|
|
11
|
-
* @returns {URL}
|
|
12
|
-
*/
|
|
13
|
-
addSlashToUrl(url: URL): URL;
|
|
14
|
-
/**
|
|
15
|
-
* Ensures trailing slash is used
|
|
16
|
-
* @param {string | undefined} address
|
|
17
|
-
* @returns {string}
|
|
18
|
-
*/
|
|
19
|
-
addSlashToAddress(address: string | undefined): string;
|
|
20
|
-
}
|
package/types/AuthorList.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MarkdownInstance } from "./Astro";
|
|
2
|
-
import type { BannerImage } from "./BannerImage";
|
|
3
|
-
export interface AuthorList {
|
|
4
|
-
image: BannerImage | null;
|
|
5
|
-
writers: MarkdownInstance[];
|
|
6
|
-
mainAuthor: MarkdownInstance | null;
|
|
7
|
-
contributors: MarkdownInstance[];
|
|
8
|
-
}
|
package/types/BannerImage.d.ts
DELETED
package/types/NavPage.d.ts
DELETED
package/types/Site.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type Site = {
|
|
2
|
-
url: string;
|
|
3
|
-
dateOptions: Intl.DateTimeFormatOptions;
|
|
4
|
-
subfolder: string;
|
|
5
|
-
feedUrl: string;
|
|
6
|
-
title: string;
|
|
7
|
-
description: string;
|
|
8
|
-
defaultLanguage: string;
|
|
9
|
-
themeColor: string;
|
|
10
|
-
owner: string;
|
|
11
|
-
default: {
|
|
12
|
-
lang: string;
|
|
13
|
-
locale: string;
|
|
14
|
-
dir: string;
|
|
15
|
-
};
|
|
16
|
-
search: {
|
|
17
|
-
fallbackUrl: 'https://www.google.com/search' | string;
|
|
18
|
-
fallbackSite: 'q' | string;
|
|
19
|
-
fallbackQuery: 'q' | string;
|
|
20
|
-
};
|
|
21
|
-
pageSize: number;
|
|
22
|
-
pageLinks: number;
|
|
23
|
-
rssLimit: number;
|
|
24
|
-
cacheMaxAge: number;
|
|
25
|
-
featureFlags: {
|
|
26
|
-
codeBlocks: 'copy'[];
|
|
27
|
-
figures: 'enlarge'[];
|
|
28
|
-
youTubeLinks: 'embed'[];
|
|
29
|
-
};
|
|
30
|
-
images: {
|
|
31
|
-
contentSize: string;
|
|
32
|
-
listerSize: string;
|
|
33
|
-
authorSize: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
package/types/Taxonomy.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface TaxonomyEntry {
|
|
2
|
-
title: string;
|
|
3
|
-
count: number;
|
|
4
|
-
}
|
|
5
|
-
export interface TaxonomyList {
|
|
6
|
-
tags: TaxonomyEntry[];
|
|
7
|
-
topTags: TaxonomyEntry[];
|
|
8
|
-
categories: TaxonomyEntry[];
|
|
9
|
-
}
|
|
10
|
-
export interface TaxonomyLinks {
|
|
11
|
-
tag: string;
|
|
12
|
-
category: string;
|
|
13
|
-
getCategoryLink: (category: string) => string;
|
|
14
|
-
getTagLink: (tag: string) => string;
|
|
15
|
-
}
|