diff options
| author | Eltrac <hi@guhub.cn> | 2025-05-21 21:18:38 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-05-21 21:18:38 +0800 |
| commit | 021a9a90fd5415262074fad37d569a4da01c7aef (patch) | |
| tree | 25318e3eb34c89e7bd400592ea574dbae62e24ea /layouts/_default | |
| parent | 7674fa264017b4ddfb419e6bfaa3d23938a1fe3f (diff) | |
fix: showing unwanted image in RSS feed
The original method of adding an "external" icon is to append an `<img>` tag to `<a>` tags, but if the reader is viewing the content from a reader where the CSS style does not work, the image is displayed in an unwanted way.
The workaround is to remove the `<img>` tag and implement this feature with only CSS pseudo-element.
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/_markup/render-link.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 16c201cd..2e8d32f7 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,6 +1,6 @@ {{ $url := .Destination | safeURL }} {{ if or (strings.HasPrefix $url "http://") (strings.HasPrefix $url "https://") }} - <a href="{{ $url }}" target="_blank" rel="noopener noreferrer">{{ .Text }}<span class="link-icon"><img class="invert-if-dark" src="/img/external-link.svg"></span></a> + <a href="{{ $url }}" class="external-link" target="_blank" rel="noopener noreferrer">{{ .Text }}</a> {{ else }} <a href="{{ $url }}">{{ .Text }}</a> {{ end }} |
