getgrav / grav-plugin-feed

Grav Feed Plugin
https://getgrav.org
MIT License
16 stars 11 forks source link

Query about importing into Obsidian from Grav #73

Open Penworks opened 5 months ago

Penworks commented 5 months ago

Hi. I don't know if any of you good people might be able to help/advise. Its a bit long, TLDR: Im getting unwanted indents in imported markdown in Obsidian from a Grav blog feed.

So I have an issue with templating posts that are being exported from a Grav blog into Obsidian. Im using your plugin to export and the Obsidian Simple RSS plugin to import. (This plugin is great, I use it for importing other feeds including Mastodon. There is total control for custom feed import and template design according to specified feed fields and items. AFAIK it is the only Obsidian RSS plugin that creates individual files in Obsidian for each post.)

The Grav blog is markdown, and Obsidian is also markdown. Im getting a layout problem for the Grav posts, shown in the screenshot below. For some reason there are multiple level indents for the image html element, and the following paragraph. All other content has no extra indents. The indents are interpreted as 'code' in Obsdn markdown and therefore it breaks the design template layout. See screenshots for edit view and read view - showing that Obsidian markdown interpret this as 'code' in both views. The raw.md file in bsidian vault shows the indents being created at import. The original markdown in Grav has no indents.

Only by manually removing the indents can I make the post behave as normal, ie an image, followed by paragraph of text.

Edit view in Obsidian: screenshot snippet of obsidian file generated from Grav RSS post, in edit view

Read view in Obsidian: screenshot snippet of obsidian file generated from Grav RSS post, in read view

The actual markdown imported into Obsidian:

screenshot of markdown in Obsidian

Indents for image and first para in the actual rss

image

I cant see any way of controlling this in the feed twig template or anywhere else. (I also cant control it at the import stage.)

Any ideas are gratefully received.

Penworks commented 5 months ago

I solved this. If the dev wants to delete this post please go ahead.. But, it might be helpful to others who come across this problem.

I solved the issue by making all the item code in the feed.rss.twig template non indented, i.e. moving all item calls to the edge (shown below), no indentation at all. This solved the problem of indents being interpreted by markdown as code blocks.

Like this:

image