diff options
| -rw-r--r-- | assets/css/components/_markdown.scss | 9 | ||||
| -rw-r--r-- | layouts/_default/_markup/render-link.html | 4 | ||||
| -rw-r--r-- | static/img/external-link.svg | 7 |
3 files changed, 18 insertions, 2 deletions
diff --git a/assets/css/components/_markdown.scss b/assets/css/components/_markdown.scss index 6be34818..2b8fc737 100644 --- a/assets/css/components/_markdown.scss +++ b/assets/css/components/_markdown.scss @@ -142,3 +142,12 @@ $em-text-color: #889E73; max-width: 100%; } } + +/* additional elements */ + +.link-icon img { + width: 0.8em; + height: 0.8em; + display: inline; + opacity: 0.7; +} diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index b7a23949..16c201cd 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 | safeHTML }}</a> + <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> {{ else }} - <a href="{{ $url }}">{{ .Text | safeHTML }}</a> + <a href="{{ $url }}">{{ .Text }}</a> {{ end }} diff --git a/static/img/external-link.svg b/static/img/external-link.svg new file mode 100644 index 00000000..ed2483aa --- /dev/null +++ b/static/img/external-link.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
+<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Interface / External_Link">
+<path id="Vector" d="M10.0002 5H8.2002C7.08009 5 6.51962 5 6.0918 5.21799C5.71547 5.40973 5.40973 5.71547 5.21799 6.0918C5 6.51962 5 7.08009 5 8.2002V15.8002C5 16.9203 5 17.4801 5.21799 17.9079C5.40973 18.2842 5.71547 18.5905 6.0918 18.7822C6.5192 19 7.07899 19 8.19691 19H15.8031C16.921 19 17.48 19 17.9074 18.7822C18.2837 18.5905 18.5905 18.2839 18.7822 17.9076C19 17.4802 19 16.921 19 15.8031V14M20 9V4M20 4H15M20 4L13 11" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
+</svg>
\ No newline at end of file |
