seankross / postcards

💌 Create simple, beautiful personal websites and landing pages using only R Markdown.
Other
551 stars 87 forks source link

Can't add a Mastodon link in links and labels #57

Open RMRubert opened 2 years ago

RMRubert commented 2 years ago

Hello,

so when a mastodon link (that contains an @) is added, the render doesn't happen properly.

Example: `--- title: "Name"

links:

imagen

Is there any way to force the url to not swap mode when the @ is added?

RMRubert commented 2 years ago

I tried replacing the @ with %40, it does compiles correctly, but the link gives me a 404. At least on firefox. https://im-in.space/@rmrubert https://im-in.space/%40rmrubert

jhelvy commented 2 years ago

Same. Others have posted on this here: https://mastodon.social/@ajamesgreen/109341659266526443

It looks like the @ symbol in the url is being rendered as a citation. Not sure if this is something that can be handled via {postcards} or if it should be handled in {distill}.

@cderv any thoughts?

limegreen commented 2 years ago

Thanks for being my post across to here @jhelvy

cderv commented 2 years ago

Usually when you want to add a @ in a doc where citation is activated, you need to escape it using \ so I would try \@ .

Usually any special markdown character (and @ is among them as used for citation) needs to be escaped when wished to be showed verbatim asis https://bookdown.org/yihui/rmarkdown-cookbook/special-chars.html

Hopefully, this is what happens here. This would mean the link added in YAML is processed as Markdown or inserted in a pre render step.

jhelvy commented 2 years ago

Welp, that did it! Except I needed to use \\, like this:

  - label: '<i class="fab fa-mastodon fa-lg"></i>'
    url: "https://fediscience.org/\\@jhelvy"
rdelrossi commented 1 year ago

Glad to have come across this thread! Thank you @cderv and @jhelvy.