Rename social.*.link to url

master
Will Faught 2 years ago
parent 7d554fa069
commit a5b2661368

@ -334,11 +334,11 @@ paige:
rss: rss:
managing_editor: "Michael Bluth" managing_editor: "Michael Bluth"
web_master: "Michael Bluth" web_master: "Michael Bluth"
social: # Social links on the home page social:
examplesite: examplesite:
bootstrap_icon: example-icon bootstrap_icon: example-icon
link: https://example.com/username name: Example
name: Example Site # Used for screen readers url: https://example.com/username
``` ```
If you set `hide_credit_data` or `hide_credit_link`, please credit this project in a post to help others find it. If you set `hide_credit_data` or `hide_credit_link`, please credit this project in a post to help others find it.

@ -53,84 +53,84 @@ params:
social: social:
discord: discord:
bootstrap_icon: discord bootstrap_icon: discord
link: https://discord.com/users/username
name: Discord name: Discord
url: https://discord.com/users/username
dribbble: dribbble:
bootstrap_icon: dribbble bootstrap_icon: dribbble
link: https://dribbble.com/username
name: Dribbble name: Dribbble
url: https://dribbble.com/username
email: email:
bootstrap_icon: envelope bootstrap_icon: envelope
link: mailto:username@example.com
name: E-mail name: E-mail
url: mailto:username@example.com
facebook: facebook:
bootstrap_icon: facebook bootstrap_icon: facebook
link: https://facebook.com/username
name: Facebook name: Facebook
url: https://facebook.com/username
github: github:
bootstrap_icon: github bootstrap_icon: github
link: https://github.com/username
name: GitHub name: GitHub
url: https://github.com/username
instagram: instagram:
bootstrap_icon: instagram bootstrap_icon: instagram
link: https://instagram.com/username
name: Instagram name: Instagram
url: https://instagram.com/username
linkedin: linkedin:
bootstrap_icon: linkedin bootstrap_icon: linkedin
link: https://linkedin.com/in/username
name: LinkedIn name: LinkedIn
url: https://linkedin.com/in/username
medium: medium:
bootstrap_icon: medium bootstrap_icon: medium
link: https://medium.com/@username
name: Medium name: Medium
url: https://medium.com/@username
pinterest: pinterest:
bootstrap_icon: pinterest bootstrap_icon: pinterest
link: https://pinterest.com/username
name: Pinterest name: Pinterest
url: https://pinterest.com/username
quora: quora:
bootstrap_icon: quora bootstrap_icon: quora
link: https://quora.com/profile/username
name: Quora name: Quora
url: https://quora.com/profile/username
reddit: reddit:
bootstrap_icon: reddit bootstrap_icon: reddit
link: https://reddit.com/u/username
name: Reddit name: Reddit
url: https://reddit.com/u/username
spotify: spotify:
bootstrap_icon: spotify bootstrap_icon: spotify
link: https://open.spotify.com/user/username
name: Spotify name: Spotify
url: https://open.spotify.com/user/username
stackoverflow: stackoverflow:
bootstrap_icon: stack-overflow bootstrap_icon: stack-overflow
link: https://stackoverflow.com/users/username
name: Stack Overflow name: Stack Overflow
url: https://stackoverflow.com/users/username
strava: strava:
bootstrap_icon: strava bootstrap_icon: strava
link: https://strava.com/athletes/username
name: Strava name: Strava
url: https://strava.com/athletes/username
twitch: twitch:
bootstrap_icon: twitch bootstrap_icon: twitch
link: https://twitch.tv/username
name: Twitch name: Twitch
url: https://twitch.tv/username
twitter: twitter:
bootstrap_icon: twitter bootstrap_icon: twitter
link: https://twitter.com/username
name: Twitter name: Twitter
url: https://twitter.com/username
vimeo: vimeo:
bootstrap_icon: vimeo bootstrap_icon: vimeo
link: https://vimeo.com/username
name: Vimeo name: Vimeo
url: https://vimeo.com/username
wordpress: wordpress:
bootstrap_icon: wordpress bootstrap_icon: wordpress
link: https://username.wordpress.com
name: Wordpress name: Wordpress
url: https://username.wordpress.com
yelp: yelp:
bootstrap_icon: yelp bootstrap_icon: yelp
link: https://yelp.com/user_details?userid=username
name: Yelp name: Yelp
url: https://yelp.com/user_details?userid=username
youtube: youtube:
bootstrap_icon: youtube bootstrap_icon: youtube
link: https://youtube.com/user/username
name: YouTube name: YouTube
url: https://youtube.com/user/username
permalinks: permalinks:
blog: /blog/:year/:month/:day/:title/ blog: /blog/:year/:month/:day/:title/
social: social:

@ -6,9 +6,9 @@
<div class="mb-3 text-center"> <div class="mb-3 text-center">
{{ range $k, $v := . }} {{ range $k, $v := . }}
{{ if hasPrefix $v.link "mailto:" }} {{ if hasPrefix $v.link "mailto:" }}
<a href="#" data-a="{{ base64Encode (index (split $v.link `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split $v.link `@`) 1) }}" onclick="this.href = atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)"><i class="bi bi-{{ $v.bootstrap_icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a> <a href="#" data-a="{{ base64Encode (index (split $v.url `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split $v.url `@`) 1) }}" onclick="this.href = atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)"><i class="bi bi-{{ $v.bootstrap_icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ else }} {{ else }}
<a href="{{ $v.link }}"><i class="bi bi-{{ $v.bootstrap_icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a> <a href="{{ $v.url }}"><i class="bi bi-{{ $v.bootstrap_icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>

Loading…
Cancel
Save