omnivore-app / obsidian-omnivore

Obsidian plugin to fetch articles and highlights from Omnivore
MIT License
813 stars 46 forks source link

template is not working #28

Closed KristineWatson closed 1 year ago

KristineWatson commented 1 year ago

图片 图片

sywhb commented 1 year ago

Hey @KristineWatson, thanks for reporting. I'm working on a fix

ltroj commented 1 year ago

Came here to ask if it's possible to configure the frontmatter via template. Seems to be the same issue. The original template doesn't contain the frontmatter part at all:

# {{{title}}}
#Omnivore

[Read on Omnivore]({{{omnivoreUrl}}})
[Read Original]({{{originalUrl}}})

{{#highlights.length}}
## Highlights

{{#highlights}}
> {{{text}}} [⤴️]({{{highlightUrl}}})
{{#note}}

{{{note}}}
{{/note}}

{{/highlights}}
{{/highlights.length}}
sywhb commented 1 year ago

We use the uuid of the article to deduplicate and it is stored in the frontmatter(YAML) so at least we might need to keep the uuid in the frontmatter and remove the others @ltroj @KristineWatson

sywhb commented 1 year ago

Something like this:

Screenshot 2023-03-08 at 8 41 53 PM
sywhb commented 1 year ago

30

ltroj commented 1 year ago

Something like this: Screenshot 2023-03-08 at 8 41 53 PM

I see. Would it be possible to create a custom frontmatter section within the template and you append the uuid field automatically?

The reason is I use an uniform frontmatter template for all my notes and would like to keep it for notes from Omnivore.

So my template within the plugin settings would look something like this:

---
title: {{{title}}}
myCustomField: "Omnivore rocks"
---
# {{{title}}}
#Omnivore
...

and when fetching an article it renders like this

---
title: "My Article from Omnivore"
myCustomField: "Omnivore rocks"
id: bdcfe210-3f5c-474e-ba10-460fb06d733c
---
# My Article from Omnivore
#Omnivore
...
sywhb commented 1 year ago

@ltroj thanks for the feedback and "Omnivore rocks" 😄

Yeah, you could have the frontmatter in the template too. This is part of my template as an example:

---
id: {{{id}}}
title: {{{title}}}
{{#labels.length}}
tags:
{{#labels}} - {{{name}}}
{{/labels}}
{{/labels.length}}
---

# {{{title}}}
#Omnivore
ltroj commented 1 year ago

Oh thanks, I didn't realize that's already possible. Will check it out!

almabel01 commented 1 year ago

Hi @sywhb, I'm afraid I am a bit dumb for this. When I put the frontmatter in the template in Obsidian, on resync it has been added after the default frontmatter. My goal is to remove the labels from the fronmatter tags and use wikilinks to the topics.

—-
id: {{{id}}}
url: {{{originalUrl}}}
omnivore_url: {{{omnivoreUrl}}}
title: {{{title}}}
author: {{{author}}}
publisher: {{{siteName}}}
date_published: {{{date}}}
tags:
date_saved: {{{dateSaved}}}
—
areas:: {{#labels.length}} {{#labels}}[[{{{name}}}]], {{/labels}}{{/labels.length}}
related notes::

# {{{title}}}

{{#highlights.length}}
## Highlights

{{#highlights}}
> {{{text}}} [⤴️]({{{highlightUrl}}})
{{#note}}

{{{note}}}
{{/note}}

{{/highlights}}
{{/highlights.length}}

Screen Shot 2023-03-08 at 20 01 17 Screen Shot 2023-03-08 at 20 02 24

sywhb commented 1 year ago

Hey @almabel01, sorry for inconvenience caused. This fix is not released yet and I will update you once it's released

KristineWatson commented 1 year ago

Got it!Thank you so much for replying ! It would be nice if it'll supported to set custom frontmatter sections like other plugins in the future😇


发件人: Hongbo Wu @.> 发送时间: 2023年3月7日 16:01 收件人: omnivore-app/obsidian-omnivore @.> 抄送: KristineWatson @.>; Mention @.> 主题: Re: [omnivore-app/obsidian-omnivore] template is not working (Issue #28)

We use the uuid of the article to deduplicate and it is stored in the frontmatter(YAML) so at least we might need to keep the uuid in the frontmatter and remove the others @ltrojhttps://github.com/ltroj @KristineWatsonhttps://github.com/KristineWatson

— Reply to this email directly, view it on GitHubhttps://github.com/omnivore-app/obsidian-omnivore/issues/28#issuecomment-1457719514, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWCEVS45VTP7ECGTMNBOWZLW23TPBANCNFSM6AAAAAAVILDAZI. You are receiving this because you were mentioned.Message ID: @.***>

sywhb commented 1 year ago

Hey @KristineWatson @ltroj @almabel01, sorry for the long delay. Please check out the new version v1.1.0

I hope it will address the issue here