@quartz-community/breadcrumbs 1.0.5 → 1.0.6
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/CHANGELOG.md +6 -0
- package/dist/components/index.js +6 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1769,6 +1769,10 @@ var FileTrieNode = class _FileTrieNode {
|
|
|
1769
1769
|
const nonIndexTitle = this.data?.title === "index" ? void 0 : this.data?.title;
|
|
1770
1770
|
return this.displayNameOverride ?? nonIndexTitle ?? this.fileSegmentHint ?? this.slugSegment ?? "";
|
|
1771
1771
|
}
|
|
1772
|
+
/** The name of the file or folder itself (as written in the content folder), not its title. */
|
|
1773
|
+
get fileName() {
|
|
1774
|
+
return this.fileSegmentHint ?? this.slugSegment ?? "";
|
|
1775
|
+
}
|
|
1772
1776
|
set displayName(name) {
|
|
1773
1777
|
this.displayNameOverride = name;
|
|
1774
1778
|
}
|
|
@@ -1908,7 +1912,8 @@ var Breadcrumbs_default = ((opts) => {
|
|
|
1908
1912
|
return null;
|
|
1909
1913
|
}
|
|
1910
1914
|
const crumbs = pathNodes.map((node, idx) => {
|
|
1911
|
-
const
|
|
1915
|
+
const name = node.isFolder && !options.resolveFrontmatterTitle ? node.fileName : node.displayName;
|
|
1916
|
+
const crumb = formatCrumb(name, slug, simplifySlug(node.slug));
|
|
1912
1917
|
if (idx === 0) {
|
|
1913
1918
|
crumb.displayName = options.rootName;
|
|
1914
1919
|
}
|