Sommerregen / grav-plugin-external-links

This plugin adds small icons to external and mailto links, informing users the link will take them to a new site or open their email client.
Other
16 stars 14 forks source link

not working anymore in Grav 1.0.7 #10

Closed axel-rank closed 8 years ago

axel-rank commented 8 years ago

Link Icons are not showing up anymore. Same in Grav 1.0.8 Icons are not shown, when the (html) link is in page header. But that was working before. Link icons in markdown works.

Sommerregen commented 8 years ago

Hi @axel-rank ,

I don't know what you mean by

Icons are not shown, when the (html) link is in page header.

Can you clarify your statement and give an example. To be clear, External Links only render links in the page content to be external (when they are) not any links in the headers. Injecting them has never worked...

axel-rank commented 8 years ago

Hi, I mean this small icon on the right that is showing up on external links. HTML Links in Page Header like: services:

Sommerregen commented 8 years ago

Hi @axel-rank ,

I really doubt that this was working. I have never considered nor tested this. However how are you injecting those header links into the page? If you are using Twig you can render the links via {{ page.content|external_links }} in your Twig file (see https://github.com/Sommerregen/grav-plugin-external-links#twig-filter).

Otherwise as long as External Links is loaded and the respective CSS style, you can add the icon by adding the class external to the link (for reference see here https://github.com/Sommerregen/grav-plugin-external-links#css-stylesheet-override). In your case a link like

<a href="http://www.lefthandgear.de" target="_blank" class="external">
  Lefthandgear - Gitarren für Linkshänder
</a>

should be rendered with an external icon (even if you are injecting it via a page header).

axel-rank commented 8 years ago

Hi, I wouldn't have opened an issue, if it hasn't worked before GRAV 1.0.7 Don't hnow why you doubt, because I can use pure html (for links) in page header of .md files, as there are a lot templates who allow to insert text: ... in headers. And those small icons for links generated were shown before Grav 1.0.7 without using class=external. But thanks for the tip, now those fancy icons are here again.

Sommerregen commented 8 years ago

Hi @axel-rank I doubted for two reasons: (i) there are no obvious changes in the latest Grav versions, which could cause such behaviour and (ii) I never have tested this kind of config and couldn't have foreseen, that this was working before.

My doubt was not against you, it was a kind of misbelieving in the sense it shouldn't work, but as it seems I was wrong. I really don't know why it has worked for you, but glad to hear that the workaround works for you :-)