-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add folder pages for empty, intermediate folders #1295
base: v4
Are you sure you want to change the base?
Conversation
Do you know what the default behaviour of Obsidian Vault is for this case? |
allFiles.flatMap((data) => { | ||
const slug = data.slug | ||
const folderName = path.dirname(slug ?? "") as SimpleSlug | ||
if (slug && folderName !== "." && folderName !== "tags") { | ||
return [folderName] | ||
} | ||
return [] | ||
return slug | ||
? _getFolders(slug).filter((folderName) => folderName !== "." && folderName !== "tags") | ||
: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can rewrite L78-82:
allFiles.flatMap((data) =>
data.slug
? getFolders(data.slug).filter(
(folderName) => folderName !== "." && folderName !== "tags",
)
: [],
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I adapted my change.
56e8b3b
to
e26448e
Compare
Sorry, could you please explain in more detail? I've observed the 404s when using quartz with Obsidian. If you mean Obsidian Publish, then I don't know, I haven't used it. |
Yes, sorry I meant Obsidian Publish. |
I think we should do
|
hmm, you can use the date from filesystem? edit: my guess is dates with latest file content is fine. |
Added the latest dates of all files underneath the subfolder to the subfolder itself (reusing byDateAndAlphbetical). |
This PR adds folder pages for intermediate folders such as in
Before, only a folder page for
bar
was created, resulting in a 404 when clicking thefoo
link inHome > foo > bar
, see issue #1084.With the change, there exists also a (albeit empty) page for
foo
. A potential follow-up would be to show not only notes, but also subfolders on folder pages.