mirnovov / obsidian-homepage

An Obsidian plugin that opens a specified note, canvas, or workspace on startup, instead of the most recent one.
MIT License
397 stars 19 forks source link

Unless you have "auto-create" turned on, Homepage can't find your daily note if it's not in the root directory #40

Closed darrencroton closed 1 year ago

darrencroton commented 1 year ago

Summary

Unless you have "auto-create" turned on, Homepage can't find your daily note if it's not in the root directory. E.g. if you keep your daily notes in a different folder.

Steps to reproduce

No response

Obsidian info

  1. Using the daily notes core plugin.

  2. Using the Homepage plugin, auto-create turned off, and set such that if my daily notes are kept in "/" (root directory) everything works fine. But if I change my daily notes location (in the core plugin) to the folder "Daily Notes" and move my daily notes there, when opening Obsidian, Homepage doesn't find today's daily note.

  3. If I turn auto-create on in Homepage, everything works correctly. Homepage then finds the daily note in the directory.

Obsidian version

1.1.16

Checklist

mirnovov commented 1 year ago

What's the content of the "Homepage format" setting?

Most folders won't be reached correctly unless you escape their names, as Moment interprets them as parts of date specifiers. This is intended, so someone can have their notes sorted in different chronological folders, e.g. YY/MM/DD.

Though typing this now, I realise this might not be clear to users, so I've added a formatting sample like the default Daily Notes plugin has in ffe431c. In a future release, I intend to make it so you can directly have your Daily Note as your homepage.

darrencroton commented 1 year ago

It's simply YYYY-MM-DD, which is the same in my daily notes plugin. I didn't see a way to add a path there, since (as you say) Homepage appears to only parse this using Moment formatting. But if there's a way to add the path here, that would be problem solved (is there? e.g. if my daily notes are in folder "Daily Notes").

However, if I turn on auto-create in the Homepage settings, then the correct directory is found and everything works fine. I was guessing that auto-create triggers a check of the core daily notes "new file location" parameter. But without auto-create, this location isn't sought. But that was just a guess.

Hence I thought it was a bug, since things work with auto-create on, but not otherwise.

mirnovov commented 1 year ago

That's odd. As things currently stand, Homepage's system is intended to be completely separate from Daily Notes. If they result in the same path, they'll work together, but they can also be used independently.

However, if I turn on auto-create in the Homepage settings, then the correct directory is found and everything works fine. I was guessing that auto-create triggers a check of the core daily notes "new file location" parameter. But without auto-create, this location isn't sought. But that was just a guess.

I've tried to replicate this, but for me it only shows the intended behaviour, which is that Homepage will create its own note in the root directory.

What you'll want is \D\a\i\l\y \N\o\t\e\s/YYYY-MM-DD. As I said earlier in future releases things will be a bit more intuitive (though it's very much a long term goal that's tied to a general overhaul of a bunch of other things).

darrencroton commented 1 year ago

I can confirm the suggestion works. Thanks. On the Obsidian forum someone else pointed out that [Daily Notes]/YYYY-MM-DD also works (for future reference for anyone stumbling across this discussion).

To highlight the behaviour I was seeing though, here's a video: https://share.icloud.com/photos/0f3Sw26PQERBKpBPK8Ldh-gmg

Recorded on my iPad, but it's the same on my MacBook. I'm not sure why Homepage can find the correct directory when auto-create is on. Anyway, it's pretty clear in the video. Hope it helps!

mirnovov commented 1 year ago

Hmm, that's really strange. I've reproduced it in a test vault and it doesn't do what you just showed. Since your setup seems to be working correctly for you and I can't seem to make it happen, I won't investigate further right now unless another user manages to make it happen, but thanks for bringing it to my attention.