obsidiosaurus
obsidiosaurus copied to clipboard
Idea: Allow for versioning within docusaurus
What I'm trying to achieve is one docusaurus instance serving two distinct docs (multi-instance), where each docs instance is versioned. Currently I'm using Obsidian to write any docs (also using i18n) and Obsidiosaurus to push it to Docusaurus to fill up the current/next docs. Setting a version happens within Docusaurus and this is totally fine with me. But when using versioning, two major downsides arise in the areas of Obsidiosaurus:
- In order to version assets, they need to be placed within the docs folder. Ideally near the .md-file itself. Currently the path is always set to "/assets/" even though I don't specify an asset folder in my vault structure and the settings in obsidian are set to "new link format: relative path" and "default location for new attachments: same folder as current file".
- Currently, with the approach depicted in 1) assets, especially image files, are corrupted. In the resulting .md-file in docusaurus they appear as .webp. Even when I set the path right and set the correct format (like .png instead of .webp) the file won't load since it is corrupted, even though it gets exported into the correct location.
The idea:
- Enable assets from within the docs folder structure (and if you like still push them through imagemagick)
This allows to write markdown files (that may or may not include assets) in obsidian and export them using obsidiosaurus into docusaurus as the current/next version. You can then version your docs using docusaurus but keep obsidian as a nice markdown editor.
Puh using multi-instance, with versioning, with i18n, that's a lot of complexity..
I am also not sure if I understand 100% your request. Could you provide a folder structure example of your idea?
True, it is a lot of complexity. That's why I just want to write the current version in obsidian and push it to docusaurus. Within docusaurus I do the versioning like I would without Obsidian and Obsidiosaurus.
The folder structure and all the push logic would stay the same with the exception of assets.
Currently assets are stored in an assets folder. Therefore they cannot be versioned within Docusaurus.
Current folder structure in Obsidian when hello-world.md references asset1.png:
- assets
- asset1.png
- docs
- project1
- dev-docs
- user-docs
- project2
- dev-docs
- hello-world.md
- user-docs
Current folder structure the Obsidian folder structure in translated to in Docusaurus:
- docs
- project1
- dev-docs
- user-docs
- project2
- dev-docs
- hello-world.md
- user-docs
- static
- assets
- asset1.webp
What I need for versioning assets correctly in Docusaurus:
- docs
- project1
- dev-docs
- user-docs
- project2
- dev-docs
- hello-world.md
- asset1.png
- user-docs
Which translates to the same Docusaurus folder structure where the asset is located at the hierarchy level of the markdown-file that references the asset.
This allows for also versioning assets.