Johannes Kaindl Uplink Deutsch

Wiki.js Maintainer

An Obsidian plugin that publishes notes from one folder of your vault to a Wiki.js wiki and keeps them in sync with it. The folder is called _published/ by default, and that already contains the whole idea of how it is used: moving a note there is the decision to publish it. No switch in the frontmatter, no publish list, no checkbox — one movement in the file tree, which you make anyway when a text is finished.

Why this one

The actual subject of this plugin is not transferring text. That is the easy part. The hard part is the question every sync tool has to answer: What do you do when you don't know for sure?

Two sides, both changeable, neither takes precedence. Someone types in the wiki while the vault is open. A page is deleted in the admin area. Two notes land on the same path. A key expires. A tool that guesses in these situations is worse than one that does nothing — because it guesses quietly, and you only notice once the text is gone.

This plugin's answer is the same everywhere: when in doubt, don't act — ask. That sounds obvious and isn't — it costs work at every single point, and each of these points was a decision of its own.

How it does it

It measures right before the jump, not ahead of it. Immediately before a page is written, the plugin fetches its modification timestamp again. Minutes can pass between "show plan" and "user clicks" — the plan is a photograph, not a contract. If the timestamp differs, a line diff appears, and the human decides.

It remembers three things instead of two. For every published page there is a snapshot: the local raw text, the version actually sent, and the remote timestamp. The conversion from Obsidian Markdown to wiki Markdown is one-way — the original cannot be recomputed from what was sent. With only two fields, the plugin could not tell "changed locally?" apart from "changed over there?". The same data will later carry a real three-way merge without anything having to be rebuilt.

It locks itself where names collide. Two notes that land on the same wiki path block each other completely until one is renamed — instead of the second silently overwriting the first. Related, but deliberately handled differently: two notes with the same name in different folders make a [[Wikilink]] ambiguous. That locks nothing — the pages are published, only the ambiguous link stays text instead of a link, and the status view says why. A missing link is visible; a link that points to the wrong one of two same-named documents is not.

It makes the reversible option the default. When a note disappears from the folder, the plugin asks — and suggests unpublishing, not deleting. The page becomes invisible, its history remains. Whoever dismisses the dialog with Esc has unpublished nothing and deleted nothing.

What the first real run taught

The plugin had 194 green tests when it first ran against a live wiki. Three bugs came out of it — all at the same seam: where the plugin's own code meets a foreign system.

The most instructive one: the API declares two fields as optional and requires them anyway. Unpublishing could therefore never have worked. Worse still, with one of the two fields the server changes the page first and stumbles afterwards — the response reported an error while the change had long since been written.

No test setup would have found that, because every mock would have done exactly what the schema promises. The lesson is uncomfortable and applies far beyond this project: A schema describes what an interface accepts — not what it requires. The first real call is therefore part of the implementation, not of acceptance.

Since then a driver checks the chain itself: it remote-controls a running Obsidian, creates pages, triggers conflicts, provokes collisions — and measures the effect in the wiki, not the message in the plugin. Exactly this difference had uncovered the bug.

Limits, on purpose

Images and attachments stay out for now; the tool transfers text. Conflicts are never merged automatically — there is the diff and the decision, nothing more. And as long as both sides have changed, the plugin does not pull the wiki version into the vault on its own: that would be the moment a sync tool starts to guess.

In the Obsidian Community Store: wikijs-maintainer — installable directly from Obsidian.

Source code: git.jkaindl.de/jkaindl/wikijs-maintainer