devbean / obsidian-wordpress

An obsidian plugin for publishing docs to WordPress.
https://devbean.github.io/obsidian-wordpress
Apache License 2.0
156 stars 20 forks source link

Obsidian-wordpress deletes Obsidian note frontmatter on publishing #71

Open OneRadRedDad opened 8 months ago

OneRadRedDad commented 8 months ago

What Happens

If I use the Wordpress publish button in Obsidian's sidebar to publish a note, my frontmatter notes are replaced with frontmatter generated by Obsidian-wordpress.

What I Expect to Happen

I expect Obsidian-wordpress to append its generated frontmatter to the end of what I already have in the document.

Workflow to reproduce this issue:

  1. Open Obsidian.md
  2. Navigate to any obsidian note with frontmatter in the publisher
    Frontmatter example:
    ---
    ImportedOn: Saturday, 18 December 2021 8:41:47 PM
    Tags: Category/Mundane-Item
    ---
  3. Click the Wordpress button in the Obisidan sidebar
  4. Click Publish

The note then then loses its existing Frontmatter and gains the following:

postId: 20
postType: post
categories:
  - 1
---
antonvh commented 7 months ago

Yes. I have the same problem! I prefer to have YAML data merged instead of replaced, because I use the metadata for more than wordpress info. At least the option to not update the metadata should be nice.

Can you point me to the bit of code that reads and replace the frontmatter metadata? Maybe I can try to fix it in a PR. I would also like to add seo snippet and keyphrase through this plugin.

Great plugin, though!

ianbetteridge commented 5 months ago

Same problem here too, which is a pain as I use templates and front matter to automatically move content around folders in Obsidian.

alexture commented 3 months ago

Same issue here, it's my main pain point with this otherwise amazing extension. :)