From 5087f269197053ac1c8f93064438af554e6b3811 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Wed, 7 Aug 2019 23:47:41 +0530 Subject: [PATCH] i dunno lol --- config.toml | 1 + layouts/partials/head.html | 2 + layouts/partials/social-icons.html | 150 +++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 layouts/partials/social-icons.html diff --git a/config.toml b/config.toml index 81ebb8e..7397181 100755 --- a/config.toml +++ b/config.toml @@ -183,6 +183,7 @@ guide and the [user documentation](https://bluestnight.com/docs/midnight/users/) ## See also: https://bluestnight.com/docs/midnight/users/site/social-icons/ [params.social] gitlab = "BluestNight/Midnight" + gitea = "nova99" ## Options used while generating server configuration files. ## See https://bluestnight.com/docs/midnight/users/server/ for more. diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1701a95..0e85711 100755 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,6 +17,8 @@ + + diff --git a/layouts/partials/social-icons.html b/layouts/partials/social-icons.html new file mode 100644 index 0000000..677334b --- /dev/null +++ b/layouts/partials/social-icons.html @@ -0,0 +1,150 @@ +{{ if ne .Social nil }} +{{- $attrs := "rel=\"me nofollow\"" -}} +{{- if .IsMember -}} + {{- $attrs = "itemprop=\"sameAs\"" -}} +{{- end -}} +{{- $scr := .Scratch -}} + +{{- $style := "square" -}} +{{- with (default "" .Social.icon_style) -}} + {{- if (or (eq (lower .) "circle") (eq (lower .) "square")) -}} + {{- $style = lower . -}} + {{- end -}} +{{- end -}} + +{{- $pronoun := "" -}} +{{- $len := 1 -}} +{{- if .IsMember -}} + {{- $pronoun = .Name -}} +{{- else -}} + {{- with ($scr.Get "sitevar").Data.members -}} + {{- $len = len . -}} + {{- end -}} + {{- $pronoun = i18n "ownerPronoun" $len -}} +{{- end -}} + +{{ with .Social.bitbucket -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-bitbucket" "User" . "URL" "https://bitbucket.org/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Fork %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "BitBucket") -}} +{{- end }} + +{{ with .Social.deviantart -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-deviantart" "User" . "URL" "https://%USER%.deviantart.com/" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "DeviantArt") -}} +{{- end }} + +{{ with .Social.email -}} + {{- partial "social-icon.html" (dict "Icon" "fas fa-envelope" "User" . "URL" "mailto:%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Send %PRONOUN% an email!" "Pronoun" $pronoun "Title" "Email") -}} +{{- end }} + +{{ with .Social.etsy -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-etsy" "User" . "URL" "https://www.etsy.com/shop/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Etsy") -}} +{{- end }} + +{{ with .Social.facebook -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-facebook-f" "User" . "URL" "https://facebook.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Facebook") -}} +{{- end }} + +{{ with .Social.flickr -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-flickr" "User" . "URL" "https://www.flickr.com/photos/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Flickr") -}} +{{- end }} + +{{ with .Social.github -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-github" "User" . "URL" "https://github.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Fork %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "GitHub") -}} +{{- end }} + +{{ with .Social.gitea -}} + {{- partial "social-icon.html" (dict "Icon" "fa fab fa-gitea" "User" . "URL" "https://git.arcusiridis.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Fork %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Gitea") -}} +{{- end }} + +{{ with .Social.gitlab -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-gitlab" "User" . "URL" "https://gitlab.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Fork %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "GitLab") -}} +{{- end }} + +{{ with .Social.gitter -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-gitter" "User" . "URL" "https://gitter.im/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Chat with %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Gitter") -}} +{{- end }} + +{{ with .Social.googleplus -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-google-plus-g" "User" . "URL" "https://plus.google.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Google Plus") -}} +{{- end }} + +{{ with .Social.instagram -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-instagram" "User" . "URL" "https://instagram.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Instagram") -}} +{{- end }} + +{{ with .Social.linkedin -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-linkedin-in" "User" . "URL" "https://linkedin.com/in/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "LinkedIn") -}} +{{- end }} + +{{ with .Social.medium -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-medium-m" "User" . "URL" "https://medium.com/@%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Medium") -}} +{{- end }} + +{{ with .Social.patreon -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-patreon" "User" . "URL" "https://patreon.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Support %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Patreon") -}} +{{- end }} + +{{ with .Social.pinterest -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-pinterest-p" "User" . "URL" "https://pinterest.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Pinterest") -}} +{{- end }} + +{{- with .Social.playstation -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-playstation" "User" . "URL" "https://my.playstation.com/profile/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Play with %PRONOUN% on PlayStation!" "Pronoun" $pronoun "Title" "PlayStation (requires login)") -}} +{{- end -}} + +{{ with .Social.quora -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-quora" "User" . "URL" "https://quora.com/profile/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Quora") -}} +{{- end }} + +{{ with .Social.reddit -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-reddit-alien" "User" . "URL" "https://www.reddit.com/user/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Reddit") -}} +{{- end }} + +{{ with .Social.slack_org -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-slack-hash" "User" . "URL" "https://%USER%.slack.com" "Attrs" $attrs "Style" $style "ReaderText" "Join %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Slack") -}} +{{- end }} + +{{ with .Social.snapchat -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-snapchat-ghost" "User" . "URL" "https://www.snapchat.com/add/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Join %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Snapchat") -}} +{{- end }} + +{{ with .Social.soundcloud -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-soundcloud" "User" . "URL" "https://soundcloud.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Listen to %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "SoundCloud") -}} +{{- end }} + +{{ with .Social.spotify -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-spotify" "User" . "URL" "https://open.spotify.com/user/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Spotify") -}} +{{- end }} + +{{ with .Social.steam -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-steam-symbol" "User" . "URL" "https://steamcommunity.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Steam") -}} +{{- end }} + +{{ with .Social.telegram -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-telegram-plane" "User" . "URL" "http://t.me/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Telegram") -}} +{{- end }} + +{{ with .Social.tumblr -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-tumblr" "User" . "URL" "https://%USER%.tumblr.com/" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Tumblr") -}} +{{- end }} + +{{ with .Social.twitch -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-twitch" "User" . "URL" "https://www.twitch.tv/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Twitch") -}} +{{- end }} + +{{ with .Social.twitter -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-twitter" "User" . "URL" "https://twitter.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Twitter") -}} +{{- end }} + +{{ with .Social.vimeo -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-vimeo-v" "User" . "URL" "https://vimeo.com/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Vimeo") -}} +{{- end }} + +{{ with .Social.xbox -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-xbox" "User" . "URL" "https://account.xbox.com/en-us/Profile?GamerTag=%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Play with %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "Xbox") -}} +{{- end }} + + +{{ with .Social.youtube -}} + {{- partial "social-icon.html" (dict "Icon" "fab fa-youtube" "User" . "URL" "https://www.youtube.com/user/%USER%" "Attrs" $attrs "Style" $style "ReaderText" "Find %PRONOUN% on %TITLE%!" "Pronoun" $pronoun "Title" "YouTube") -}} +{{- end }} +{{ end }}