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

github.com/halogenica/beautifulhugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstafusa <74922195+stafusa@users.noreply.github.com>2022-09-30 15:13:49 +0300
committerGitHub <noreply@github.com>2022-09-30 15:13:49 +0300
commit33fdbfed9219de3b30ab4e68c9d3a832038e7c4e (patch)
tree20cc3ad4e54e8541dffc74ecb2c5210171ae087c
parent4b5a7c7534c9acdb3e185adc6b23318c91c535dd (diff)
Implement more general Gitlab link. (#447)
* Implement more general Gitlab link. Closes halogenica/beautifulhugo#436 . * Implement more general Social Icons links. Closes halogenica/beautifulhugo#436 . * Tests for http:// and https://. Closes halogenica/beautifulhugo#436 .
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/footer.html6
2 files changed, 6 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 4884ca2..dd58fbd 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -43,6 +43,7 @@ pygmentsCodefencesGuessSyntax = true
# desc = "Hexagon"
[Author]
+ # Set only your "username" for default hosts and full URLs otherwise (e.g., "https://MyGitLab.org/username")
name = "Some Person"
website = "yourwebsite.com"
email = "youremail@domain.com"
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 87f6a1e..cc39232 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -9,7 +9,11 @@
{{ range .Site.Data.beautifulhugo.social.social_icons }}
{{- if isset $.Site.Author .id }}
<li>
- <a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
+ {{ if or ( hasPrefix ( index $.Site.Author .id ) "http://" ) ( hasPrefix ( index $.Site.Author .id ) "https://" ) }}
+ <a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf "%s" (index $.Site.Author .id) }}" title="{{ .title }}">
+ {{ else }}
+ <a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
+ {{ end }}
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="{{ .icon }} fa-stack-1x fa-inverse"></i>