@quartz-community/folder-page 1.0.1 → 1.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/CHANGELOG.md +7 -0
- package/dist/components/index.js +9 -9
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +37 -28
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bdb1aaa: Generate folder pages for folders that hold only virtual pages, such as `.base` or `.canvas` files rendered by bases-page / canvas-page, so going up a level no longer gives a 404 (jackyzha0/quartz#2576). Folder listings now also list a subfolder that has its own index page, and fall back to all pages when the folder is not in Quartz's folder hierarchy.
|
|
8
|
+
- 398001e: Bundles `@quartz-community/utils` 1.1.0: a short wikilink to an Obsidian folder note (`[[Topic]]` for `Topic/Topic.md`) reaches the folder page, and anchors to headings use the same slug as heading ids. `github-slugger` is no longer a dependency of this plugin.
|
|
9
|
+
|
|
3
10
|
## 1.0.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/components/index.js
CHANGED
|
@@ -287,8 +287,6 @@ function byDateAndAlphabetical() {
|
|
|
287
287
|
return f1Title.localeCompare(f2Title);
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
|
|
291
|
-
// node_modules/@quartz-community/utils/dist/path.js
|
|
292
290
|
function simplifySlug(fp) {
|
|
293
291
|
const res = stripSlashes(trimSuffix(fp, "index"), true);
|
|
294
292
|
return res.length === 0 ? "/" : res;
|
|
@@ -2782,7 +2780,10 @@ function pagesFromAllFiles(allFiles, folderSlug, showSubfolders) {
|
|
|
2782
2780
|
}
|
|
2783
2781
|
for (const [subfolderName, files] of subfolderFiles) {
|
|
2784
2782
|
const indexFile = files.find((f3) => f3.slug === `${folderPrefix}${subfolderName}/index`);
|
|
2785
|
-
if (indexFile)
|
|
2783
|
+
if (indexFile) {
|
|
2784
|
+
if (indexFile.unlisted !== true) directChildren.push(indexFile);
|
|
2785
|
+
continue;
|
|
2786
|
+
}
|
|
2786
2787
|
directChildren.push({
|
|
2787
2788
|
slug: `${folderPrefix}${subfolderName}/index`,
|
|
2788
2789
|
dates: mostRecentDatesFromEntries(files),
|
|
@@ -2829,16 +2830,15 @@ var FolderContent_default = ((opts) => {
|
|
|
2829
2830
|
const FolderContent = (props) => {
|
|
2830
2831
|
const { tree, fileData, allFiles, cfg } = props;
|
|
2831
2832
|
const ctx = props.ctx;
|
|
2832
|
-
const
|
|
2833
|
-
if (!
|
|
2833
|
+
const slug = fileData?.slug;
|
|
2834
|
+
if (!slug) return null;
|
|
2834
2835
|
const trie = ctx?.trie;
|
|
2835
2836
|
let allPagesInFolder;
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
if (!folder) return null;
|
|
2837
|
+
const folder = trie?.findNode(slug.split("/"));
|
|
2838
|
+
if (folder) {
|
|
2839
2839
|
allPagesInFolder = pagesFromTrie(folder, options.showSubfolders);
|
|
2840
2840
|
} else {
|
|
2841
|
-
allPagesInFolder = pagesFromAllFiles(allFiles ?? [],
|
|
2841
|
+
allPagesInFolder = pagesFromAllFiles(allFiles ?? [], slug, options.showSubfolders);
|
|
2842
2842
|
}
|
|
2843
2843
|
const cssClasses = fileData?.frontmatter?.cssclasses ?? [];
|
|
2844
2844
|
const classes = cssClasses.join(" ");
|