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

The '@' should be not part of the author variable in file names #52

Open
titusio opened this issue Sep 28, 2023 · 3 comments
Open

The '@' should be not part of the author variable in file names #52

titusio opened this issue Sep 28, 2023 · 3 comments

Comments

@titusio
Copy link

titusio commented Sep 28, 2023

My export looks something like this:
image

The import fails because the '@' character is not allowed for naming files. This results in this error message:

Bildschirmfoto 2023-09-28 um 15 06 13

It would be really helpful if the '@' character would just be removed.

@matayaaa
Copy link

matayaaa commented Dec 8, 2023

this! How to exclude ALL syntax that will mess up obsidian sync??

@0xDezzy
Copy link

0xDezzy commented Jan 29, 2024

For those trying to solve this, go to the customize section by clicking the button in the extension settings then in the yaml frontmatter change {{author}} to {{author|replace("@","")}}

@tyler-dot-earth
Copy link
Contributor

tyler-dot-earth commented Jun 8, 2024

Hello! Contributor to the plugin here. Sanitization is an issue with the export functionality itself (readwise's backend), not the plugin. I've reported it to them in a formal bug report - I'd encourage you to also do the same. You can submit a formal bug report in Reader.

That said, here's my own exports configuration for filename and front matter santization. You'll wanna use these snippets on the export preferences page.

File name config

{{ title|replace('@', '')|replace('#', 'no.')|replace('^', '')|replace('[', '(')|replace(']', ')')|replace('^', '')|replace(': ', ' - ')|replace(' | ', ' - ')  }}

^ note that there's a few opinionated replacements in there. I explain them here.

YAML Front matter (note that @ is allowed in frontmatter if you quote it)

aliases:
  - "{{title}}"
{% if author %}author: "{{author}}"{% endif %}
{% if document_tags %}related to: {% for tag in document_tags %}
  - "[[{{tag}}]]"{% endfor %}{% endif %}
tags:
  - artifact/readwise{% if category %}/{{category}}{{ "📚" if category == "books"}}{{"📰" if category == "articles"}}{{"🐦" if category == "tweets"}}{{"🎙" if category == "podcasts"}}{% endif %}

@0xDezzy worth noting that you can just use quotes around it like "{{ author }}" in frontmatter instead of replacing it.

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

4 participants