eleventy-plugin-nav 0.0.1 → 0.0.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/_includes/breadcrumbs/advanced.njk +3 -0
- package/_includes/sidebar/groups.njk +1 -1
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/data/parent.js +0 -6
- package/src/data/visible.js +1 -1
- package/src/data.js +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{% if trail.length > 0 %}
|
|
2
2
|
<nav class="breadcrumbs">
|
|
3
3
|
{% for ancestor in trail %}
|
|
4
|
+
<li>
|
|
4
5
|
<a href="{{ ancestor.page.url }}">{{ ancestor.data.title }}</a>
|
|
5
6
|
{% if ancestor.data.siblings.length > 1 %}
|
|
6
7
|
<ul class="siblings">
|
|
@@ -9,5 +10,7 @@
|
|
|
9
10
|
{% endfor %}
|
|
10
11
|
</ul>
|
|
11
12
|
{% endif %}
|
|
13
|
+
</li>
|
|
12
14
|
{% endfor %}
|
|
15
|
+
</nav>
|
|
13
16
|
{% endif %}
|
package/package.json
CHANGED
package/src/config.js
CHANGED
package/src/data/parent.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getCollectionItemFromUrl } from "./util.js";
|
|
2
|
-
import config from "../config.js";
|
|
3
2
|
|
|
4
3
|
/** @typedef {import("@11ty/eleventy").CollectionItem} CollectionItem */
|
|
5
4
|
|
|
@@ -26,11 +25,6 @@ export function parentUrl (data) {
|
|
|
26
25
|
let { parent, page } = data;
|
|
27
26
|
let ret = getParentUrl(page.url, parent);
|
|
28
27
|
|
|
29
|
-
if (config.ignoreAncestor?.(ret)) {
|
|
30
|
-
let ancestorItem = getCollectionItemFromUrl(ret, data);
|
|
31
|
-
return ancestorItem.parentUrl;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
28
|
return ret;
|
|
35
29
|
}
|
|
36
30
|
|
package/src/data/visible.js
CHANGED
package/src/data.js
CHANGED