Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/adityatelange/hugo-PaperMod.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2022-07-08 17:59:56 +0300
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2022-07-08 17:59:56 +0300
commit4824f4623d47064ee29c273ad60a7d77f1ca9e0a (patch)
treee46844ecd861ec2762ba1bbd0103c592440e07f9
parente3c30b4e41e046c76402bce55233598ee01bb543 (diff)
Mark External link with an SVG icon
in profile-mode buttons and Menu
-rw-r--r--layouts/partials/header.html8
-rw-r--r--layouts/partials/index_profile.html12
2 files changed, 19 insertions, 1 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index a2b09a4a..732f8236 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -131,6 +131,14 @@
{{- .Name -}}
{{ .Post -}}
</span>
+ {{- if (findRE "://" .URL) }}
+ <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round"
+ stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="12" width="12">
+ <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
+ <path d="M15 3h6v6"></path>
+ <path d="M10 14L21 3"></path>
+ </svg>
+ {{- end }}
</a>
</li>
{{- end }}
diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html
index 515073e4..fe489427 100644
--- a/layouts/partials/index_profile.html
+++ b/layouts/partials/index_profile.html
@@ -35,7 +35,17 @@
<div class="buttons">
{{- range . }}
<a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name }}">
- <span class="button-inner">{{ .name }}</span>
+ <span class="button-inner">
+ {{ .name }}
+ {{- if (findRE "://" .url) }}
+ <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round"
+ stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="14" width="14">
+ <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
+ <path d="M15 3h6v6"></path>
+ <path d="M10 14L21 3"></path>
+ </svg>
+ {{- end }}
+ </span>
</a>
{{- end }}
</div>