lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
199 stars 98 forks source link

XMPP link not working in side bar socials. #97

Closed ARBoyGo closed 1 year ago

ARBoyGo commented 1 year ago

When I added XMPP in social media, the HTML output is <a target="_blank" class="social" href="#ZgotmplZ"> for sample you can use my repo.

git clone https://github.com/ARBoyGo/arboygo.github.io.git cd main hugo server

For now I manually edited. My site The way currently pushing is very bad. I need to use github CLI.

lukeorth commented 1 year ago

Hi @ARBoyGo, the XMPP and Matrix social icons look good. I can include both of these in the theme itself -- that way you don't have to maintain your own fork. If you want to open a PR, I'll happily accept. Otherwise I can add them myself too. :slightly_smiling_face:

I'm admittedly not that familiar with XMPP though. What does an XMPP link look like? Can you please provide an example?

ARBoyGo commented 1 year ago

I'll push the changes.. Email Icon also changed.

XMPP link is xmpp:arboy@macaw.me The browser check if they have any XMPP client.

The link should be <a target="_blank" class="social" href="xmpp:arboy@macaw.me">

ARBoyGo commented 1 year ago

@lukeorth, Hey I made the site to utilise github workflow action, Now I can't change it manually. Can you find a solution.

I'm repeating the issue,

When I added, XMPP link, The output link is, <a target="_blank" class="social" href="#ZgotmplZ"> and the actual link should be, <a target="_blank" class="social" href="xmpp:username@instances.com">

lukeorth commented 1 year ago

@ARBoyGo, thanks for reporting this issue. According to this Hugo support request, "ZgotmplZ" is a special value that indicates unsafe content reached a CSS or URL context at runtime. This is helpful to prevent users from accidentally introducing unusual/suspicious content into their sites. I guess because the XMPP link uses a protocol other than http/https, Hugo wasn't sure it was safe.

The fix (in case you were curious) was to mark it as "safe" using Hugo's safeHTMLAttr function.

That said, this should be fixed now. Thanks again for your help. :+1:

ARBoyGo commented 1 year ago

Thanks for the effort :)