Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brackets added automatically to dates on import #184

Open
Petemir opened this issue Apr 18, 2024 · 2 comments
Open

Brackets added automatically to dates on import #184

Petemir opened this issue Apr 18, 2024 · 2 comments

Comments

@Petemir
Copy link

Petemir commented Apr 18, 2024

Hello!

First of all, thanks for this whole ecosystem, is really a great help :) (if only I'd manage to use it consistently...).

That said, I have been trying to import my (read) omnivore items into logseq for processing. On first sync, I ended up with lots of pages that I didn't wanted/needed, product of the attributes et al. I then edited the article and highlight templates, but I still end up with pages I don't want to be created. Namely, the dateSaved and datePublished variables seem to add brackets to the imported note, even when there are no brackets in the template.

The consequence is lots of created pages on the Journal section (which I expect to use for journaling) with reference links to information I don't want there (Omnivore's articles/highlights). This doesn't happen with other variables (such as labels.name), where I removed the brackets and successfully avoided the creation of spurious pages.

Any advice on how to fix this would be greatly appreciated. Thanks!

Redacted plugin settings:

{
  "generalSettings": "",
  "apiKey": "REDACTED",
  "filter": "advanced",
  "customQuery": "in:archive label:REDACTED",
  "highlightOrder": "the time that highlights are updated",
  "isSinglePage": false,
  "createTemplate": "",
  "createTemplateDesc": "",
  "articleTemplate": "[{{{title}}}]({{{omnivoreUrl}}})\ncollapsed:: false\nsite: {{#siteName}}[{{{siteName}}}]{{/siteName}}({{{originalUrl}}})\n{{#labels.length}}\nlabels: {{#labels}}{{{name}}}, {{/labels}}\n{{/labels.length}}\ndate-saved: {{{dateSaved}}}\n{{#datePublished}}\ndate-published: {{{datePublished}}}\n{{/datePublished}}",
  "highlightTemplate": "> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #[[{{{name}}}]] {{/labels}}\n\n{{#note.length}}{{{note}}}{{/note.length}}",
  "syncContent": false,
  "advancedSettings": "",
  "frequency": 60,
  "syncAt": "REDACTED",
  "graph": "REDACTED",
  "pageName": "{{{title}}}",
  "headingBlockTitle": "",
  "endpoint": "https://api-prod.omnivore.app/api/graphql",
  "disabled": false,
  "version": "v1.16.4",
  "syncJobId": 17,
  "loading": false
}
@thiswillbeyourgithub
Copy link

I noticed that too and for me it's also an inconvenience. I think that by not adding brackets it would leave the choice to the user to have this or not by simply modifying the template. It could even be in the default template ! As long as we can disable it.

@Petemir
Copy link
Author

Petemir commented Apr 18, 2024

Probably the reason:

Link

export const dateReference = (
  date: Date,
  preferredDateFormat: string
): string => {
  return `[[${formatDate(date, preferredDateFormat)}]]`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants