Configuration driven social network icon links
Defines three types of links: email, PGP public key, and profile links.master
							parent
							
								
									53baef4d8b
								
							
						
					
					
						commit
						a53fb3666f
					
				|  | @ -55,3 +55,37 @@ paginate = 5 | |||
|     type = "PGP" | ||||
|     value = "pgp_key_file.txt" | ||||
|     authn = false | ||||
| 
 | ||||
|   # Configuration parameters for social network links | ||||
|   [[params.Social]] | ||||
|     profile = "MastodonProfileLink" | ||||
|     icon = "fa fa-mastodon" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     profile = "TwitterProfileLink" | ||||
|     icon = "fa fa-twitter" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     profile = "GitHubProfileLink" | ||||
|     icon = "fa fa-github" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     profile = "GitLabProfileLink" | ||||
|     icon = "fa fa-gitlab" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     profile = "GiteaProfileLink" | ||||
|     icon = "fa fa-gitea" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     profile = "FacebookProfileLink" | ||||
|     icon = "fa fa-facebook" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     email = "email@example.com" | ||||
|     icon = "fa fa-envelope-o" | ||||
| 
 | ||||
|   [[params.Social]] | ||||
|     publicKey = "pgp_key_file.txt" | ||||
|     fingerprint = "AAAA BBBB CCCC DDDD" | ||||
|     icon = "fa fa-key" | ||||
|  | @ -1,3 +1,11 @@ | |||
| <div class="social-box"> | ||||
|     <a class="glyph" href="."><i class="fa fa-mastodon"></i></a> | ||||
|     {{ range .Site.Params.Social }} | ||||
|     {{ if .email }} | ||||
|     <a class="glyph u-email" href="mailto:{{ .email }}" rel="me"><i class="{{ .icon }}"></i></a> | ||||
|     {{ else if .publicKey }} | ||||
|     <a class="glyph p-pgp" href="{{ .publicKey }}" rel="pgpkey" title="{{ .fingerprint }}"><i class="{{ .icon }}"></i></a> | ||||
|     {{ else }} | ||||
|     <a class="glyph" href="{{ .profile }}" rel="me"><i class="{{ .icon }}"></i></a> | ||||
|     {{ end }} | ||||
|     {{ end }} | ||||
| </div> | ||||
		Loading…
	
		Reference in New Issue