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.
@@ -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
@@ -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
- navPages[navPages.length -1].url = currentUrl.pathname;
54
+ if (customCount === 0) {
55
+ navPages[navPages.length -1].url = currentUrl.pathname;
56
+ }
54
57
 
55
58
  this.setCurrentPage(navPages, currentUrl);
56
59
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef { import("../types/Link").Link } Link
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 = any;
15
+ export type Link = import("../../types/Link").Link;
package/lib/v1/paging.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef { import("../types/Link").Link } Link
2
+ * @typedef { import("../../types/Link").Link } Link
3
3
  */
4
4
 
5
5
  export class Paging {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-accelerator-utils",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "Astro utilities for Astro Accelerator.",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -0,0 +1,6 @@
1
+ export interface Link {
2
+ title: string;
3
+ url: string;
4
+ ariaCurrent: 'page' | false;
5
+ class: string;
6
+ }