Zettelkasten Forum


Seeking a Better Way to Handle ID-Based Links Between Archive and Obsidian

I primarily use The Archive as my main Zettelkasten app but rely on Obsidian for syncing across devices and accessing my notes on mobile. One challenge I face is how links work between the two apps.

In The Archive, my notes are linked using unique IDs, while the file names follow the format "ID Title". However, in Obsidian, linking by ID alone isn't straightforward as each time I click a link, a new blank note opens. I know I can use aliases to make the links compatible, but I don't like how they appear in my notes—I'd prefer to keep just the ID visible.

What I'm looking for:
- A way for Obsidian to recognize and resolve ID-based links properly.
- Ideally, when clicking or transcluding a link, it should display the corresponding note without needing an alias in the text.
- A solution that works on mobile, where clicking these links currently opens a new link every time, making navigation cumbersome.

I've checked the Obsidian forums but haven't found a clear answer. Has anyone here found a creative workaround for this? Any insights would be much appreciated!

Comments

  • I have the same problem.

    Up!

    Selen. Psychology freak.

    “You cannot buy the revolution. You cannot make the revolution. You can only be the revolution. It is in your spirit, or it is nowhere.”

    ― Ursula K. Le Guin

  • I'm also interested

  • Adding a link to previous exchange on link as search vs link as direct
    https://forum.zettelkasten.de/discussion/1101/link-as-search-vs-link-as-direct

  • I believe there was an Obsidian plugin or setting to convert ID-only-links in your notes so that they become full titles.

    It's not enabling Obsidian to be compatible with the way The Archive treats links, but it'll change your notes so that navigation works in Obsidian at all.

    While not ideal, I believe that's as good as it will get :/

    Author at Zettelkasten.de • https://christiantietze.de/

  • @ctietze said:
    I believe there was an Obsidian plugin or setting to convert ID-only-links in your notes so that they become full titles.

    I didn't find any plugin like the one you mentioned.

    What I do is always use links with UID title (same as file name), and all notes have the aliases property with the UID just for future-proofing.
    I think that, like everything in life, if we want more than one thing, we will always have to give up something.

  • @ivomota said:
    I didn't find any plugin like the one you mentioned.

    I think it is this one:
    https://github.com/snezhig/obsidian-front-matter-title

  • @ashish said:

    @ivomota said:
    I didn't find any plugin like the one you mentioned.

    I think it is this one:
    https://github.com/snezhig/obsidian-front-matter-title

    Thank you
    But it seems that what this does is just add an alias to every link. This is probably not what we want.

  • I've experiment with writing Obsidian plugins for this. I was able to create a plugin that resolved zettel-links properly, instead of creating a new file when a zettel-link was clicked.

    This allows the standard Obsidian links to work properly, and to update properly, while the zettel-links function as zettel-links are intended to.

    I was also able to create a plugin that generated the zettel-links within Obsidian. However, I was not able to override the default Obsidian behavior for creating new links; meaning you had to implement the zettel-links either manually or with a special command.

    It's not perfectly smooth, but this suggests you could interoperate between The Archive and Obsidian.

  • @micahredding You can post the link to the plugin for our arch enemy. :)

    I am a Zettler

  • It looks like the IDs for The Archive have a consistent length of 12 integers, specifically YYYYMMDDHHMM. If this is true, then the first two numbers of any note from The Archive should always start with either 19 or 20, depending on how long you've been taking notes. This means you can target The Archive links using CSS attribute selectors, then specify a maximum character width only for those links, for example:

    a[href^="19"], a[href^="20"] {
      position: relative;
      overflow: hidden;
      display: inline-block;
      max-width: 12ch; /* adjust to desired link length */
      white-space: nowrap;
      margin-bottom: -0.15em; /* adjust to align the link with surrounding text */
    }
    

    You just need to add this to your Obsidian snippets. You might also need to add or tweak some other CSS so things look right.

    Keep in mind that this will lop off any extra characters in the link text. So, while you can still use aliases, they shouldn't be longer than 12 characters. Link that don't start with 19 or 20 should still work normally.

  • @ashish said:
    I primarily use The Archive as my main Zettelkasten app but rely on Obsidian for syncing across devices and accessing my notes on mobile.

    If The Archive is your main ZK app then your UIDs probably look something like YYYYMMDDHHmm, i.e. 12 characters. You can constrain any link text to 12 characters using max-width: 12ch; in a CSS snippet. For example:

    a {
      font-family: Courier; /* necessary for constant character width */
      position: relative;
      overflow: hidden;
      display: inline-block;
      max-width: 12ch; /* adjust as necessary; px, em, etc. can also be used */
      white-space: nowrap;
      margin-bottom: -0.4em; /* necessary to align link baseline with surrounding text */
    }
    

    Keep in mind that this is applied to all links, which means all link texts will be shortened to 12 characters. That means if you have links with something like the following:

    Then they will end up looking like this:

    Unfortunately, I can't see a way to target only ZK links since in Obsidian the href is always #. Otherwise you could do something like a[href^="19"], a[href^="20"] {...} instead of just a {...}.

    One last caveat is that this solution works best when using a monospaced font, which is why I use font-family: Courier; above. For more consistent fonts you would need to change the fonts in Obsidian's settings, in which case you could then remove font-family: Courier; from the CSS. There are some very nice monospaced fonts out there if you're interested.

Sign In or Register to comment.