URL Scheme: Link to #Hashtags

Use case or problem

Sometimes I’d like a quick link to a #hashtag, but I don’t want that particular note to be included in the #hashtag.

For example:

  • I have #dailyNotes and I have #weeklyNotes
  • I would love to have a link to #weeklyNotes within my #dailyNote template so that I can quickly jump to my #weeklyNotes. But I do not want my #dailyNotes to be a part of the #weeklyNotes #hashtag.

Proposed solution

I think both of these could work nicely:

  1. Support for opening hashtags in URL Scheme:
    • something like: obsidian://open-hashtag?vault=some-vault-name&hashtag=some-hashtag
    • This would open a search with the term tag:#some-hashtag i.e. it would behave just like clicking a #hashtag link already works.
  2. Support for hashtags in [[wiki links]]
    • #myHashtag means this note is a note under #myHashtag
    • [[#myHashtag]] means this is merely a link to #myHashtag and this note is NOT a note under #myHashtag

Current workaround (optional)

  1. Create a new note with the same name as your hashtag (minus the # since it doesn’t seem like # can be in note names). Like: [[myHashtag]]
  2. Add that same hashtag to that note. Like #myHashtag
  3. Now whenever you want to “link” to a hashtag without adding that note as a member of that hashtag, all you need to do is link to [[myHashtag]].
  4. Then when you want to use the “link” just click[[myHashtag]] and your #myHashtag will be in that note.

Drawbacks:

  • this will clutter your graph
  • extra steps make the “link” less convenient.
1 Like

I got you:
obsidian://search?vault=my%20vault&query=tag%3A%23someTag

Note the URL encoding of the tag:#someTag parameter/value. : is %3A, # = %23.

5 Likes

This is great! Thank you so much.

3 Likes

I have the same request. Perhaps #! or ## for this kind of link.

It would be great for daily notes and navigation pages/MOCs.

But Ryanjamurphy’s solution is really great in the meantime, thanks!

EDIT: For anyone trying to make the link work:

  • it only works as a full link with display text, not as a raw link. E.g. [Search for SomeTag hashtag](obsidian://search?vault=my%20vault&query=tag%3A%23someTag)
  • (But if you put the hashtag in the display text, the note will show up in the search, so add a space or another character or write out “hashtag” instead.)
  • if it’s in the same vault, you don’t need the vault term.
  • you only need to replace the # with %23 and spaces with %20. The search can include colons. E.g. this is a valid link: [Search for notes with both # some-tag and # some-other-tag](obsidian://search?query=tag:%23some-tag%20tag:%23some-other-tag)
2 Likes

I really like the idea of using #! although I think !# would be more consistent with the rest of Obsidian. For example:

  • #someTag would mean this note is tagged with the someTag tag.
  • !#someTag would NOT mean that the note is tagged. Instead it would be a link to the hashtag.
1 Like