kbravh / obsidian-tweet-to-markdown

An Obsidian.md plugin to save tweets as Markdown files.
MIT License
195 stars 12 forks source link

Missing Frontmatter #20

Closed IanPatterson99 closed 2 years ago

IanPatterson99 commented 2 years ago

If I save a thread of tweets, the saved MD file correctly includes frontmatter. If however I just paste a tweet link into a note, which the plugin catches and embeds a link to the saved MD file, that file doesn’t include frontmatter regardless of setting. Is there a reason for this? I’d like it in all distinct files. The issue is that around about line 4060 in main.js the embed case doesnt include frontmatter.concat() (Or at least I think thats the issue - it works when I amend it locally )

Also, would it be possible to get Settings to include a tag line that’s included in frontmatter when enabled, eg so that if I entered ‘savedTweet’ in this setting I’d get tags: [savedTweet] in the saved frontmatter?

Thx

kbravh commented 2 years ago

Thanks for catching this bug! I haven't given enough attention to the pasting feature 😞 Let me get a fix out for that now.

And thanks for the suggestion about the tags, I've been curious what sort of customization options people might like. Custom tags will be straightforward.

kbravh commented 2 years ago

@IanPatterson99 I've just released version 2.5.1, which fixes the frontmatter issue. I'll release the frontmatter tags bit later today hopefully.

IanPatterson99 commented 2 years ago

Thanks for doing that so quickly - yes, the frontmatter appears now.

I was pulling too over what might be good todo. Allowing for a collection of tags enables a lot directly or indirectly. One other explicit line to include might be for cssclass so people can use their own snippets on it. Just a fixed line to include in all YAML it creates. More generally, just a user entered line so they can add any fixed YAML entry might do. Havent yet seen a use I'd have for going as far as having a Templater template pulled in too.

Thanks again

kbravh commented 2 years ago

tags and cssclass would be perfect, I'll get to work on both of those. Freeform frontmatter would be simple to add as well.

The idea for a template is very interesting; I'm going to add it to an idea backlog and play around with it.

kbravh commented 2 years ago

Version 2.6.0 is out now (or should be in a few minutes). I've added a field for tags, cssclass, and a freeform entry for frontmatter customization. Hope this helps, and thanks for the suggestions!

IanPatterson99 commented 2 years ago

Thank you - yes, that works. Thanks too for the plugin - v useful