astro-accelerator-utils 0.2.15 → 0.2.17
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/v1/navigation.d.mts +2 -1
- package/lib/v1/navigation.mjs +5 -2
- package/lib/v1/paging.d.mts +2 -2
- package/lib/v1/paging.mjs +1 -1
- package/package.json +1 -1
- package/types/Link.d.ts +6 -0
package/lib/v1/navigation.d.mts
CHANGED
|
@@ -20,9 +20,10 @@ export class Navigation {
|
|
|
20
20
|
* Returns a list of breadcrumbs
|
|
21
21
|
* @param {URL} currentUrl
|
|
22
22
|
* @param {string} subfolder
|
|
23
|
+
* @param {number} customCount
|
|
23
24
|
* @returns {NavPage[]}
|
|
24
25
|
*/
|
|
25
|
-
breadcrumbs(currentUrl: URL, subfolder: string): NavPage[];
|
|
26
|
+
breadcrumbs(currentUrl: URL, subfolder: string, customCount: number): NavPage[];
|
|
26
27
|
/**
|
|
27
28
|
*
|
|
28
29
|
* @param {URL} currentUrl
|
package/lib/v1/navigation.mjs
CHANGED
|
@@ -25,9 +25,10 @@ export class Navigation {
|
|
|
25
25
|
* Returns a list of breadcrumbs
|
|
26
26
|
* @param {URL} currentUrl
|
|
27
27
|
* @param {string} subfolder
|
|
28
|
+
* @param {number} customCount
|
|
28
29
|
* @returns {NavPage[]}
|
|
29
30
|
*/
|
|
30
|
-
breadcrumbs(currentUrl, subfolder) {
|
|
31
|
+
breadcrumbs(currentUrl, subfolder, customCount) {
|
|
31
32
|
const allPages = this.posts.all();
|
|
32
33
|
|
|
33
34
|
const pathParts = currentUrl.pathname.split('/');
|
|
@@ -50,7 +51,9 @@ export class Navigation {
|
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
if (customCount === 0) {
|
|
55
|
+
navPages[navPages.length -1].url = currentUrl.pathname;
|
|
56
|
+
}
|
|
54
57
|
|
|
55
58
|
this.setCurrentPage(navPages, currentUrl);
|
|
56
59
|
|
package/lib/v1/paging.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../../types/Link").Link } Link
|
|
3
3
|
*/
|
|
4
4
|
export class Paging {
|
|
5
5
|
/**
|
|
@@ -12,4 +12,4 @@ export class Paging {
|
|
|
12
12
|
*/
|
|
13
13
|
links(limit: number, numberOfPages: number, currentPage: number, url: string): Link[];
|
|
14
14
|
}
|
|
15
|
-
export type Link =
|
|
15
|
+
export type Link = import("../../types/Link").Link;
|
package/lib/v1/paging.mjs
CHANGED
package/package.json
CHANGED