Merge pull request #4 from verkaufer/profile_links_as_partial

Use a partial to render social profile links
This commit is contained in:
Rahul Tiwari 2020-04-19 12:24:31 +05:30 committed by GitHub
commit a61b1473e3
3 changed files with 27 additions and 35 deletions

View File

@ -3,14 +3,6 @@ Name = ""
# Supports markdown
About = ""
# Add only the handle
Github = ""
Twitter = ""
# Add the absolute links
Goodreads = ""
Linkedin = ""
Email = ""
# Add the filename with file extension.
@ -18,3 +10,19 @@ Resume = ""
# Sets the number of posts to display on the front page
PostLimit = 4
[[profiles]]
name = "GitHub"
url = ""
[[profiles]]
name = "Twitter"
url = ""
[[profiles]]
name = "Goodreads"
url = ""
[[profiles]]
name = "LinkedIn"
url = ""

View File

@ -9,31 +9,9 @@
<h4>{{ .Site.Data.personalize.About| markdownify }}</h4>
<table>
<tr>
{{ if ne .Site.Data.personalize.Github "" }}
<td><i class="fab fa-github" aria-hidden="true"></i></td>
<td>&nbsp;<a href="https://github.com/{{ .Site.Data.personalize.Github }}" target="_blank">GitHub</a></td>
{{ range .Site.Data.personalize.profiles }}
{{ partial "profile_link.html" . }}
{{ end }}
</tr>
<tr>
{{ if ne .Site.Data.personalize.Twitter "" }}
<td><i class="fab fa-twitter" aria-hidden="true"></i></td>
<td>&nbsp;<a href="https://twitter.com/{{ .Site.Data.personalize.Twitter }}" target="_blank">Twitter</a>
</td>
{{ end }}
</tr>
<tr>
{{ if ne .Site.Data.personalize.Goodreads "" }}
<td><i class="fab fa-goodreads" aria-hidden="true"></i></td>
<td>&nbsp;<a href="{{ .Site.Data.personalize.Goodreads }}" target="_blank">Goodreads</a></td>
{{ end }}
</tr>
<tr>
{{ if ne .Site.Data.personalize.Linkedin "" }}
<td><i class="fab fa-linkedin" aria-hidden="true"></i></td>
<td>&nbsp;<a href="{{ .Site.Data.personalize.Linkedin }}" target="_blank">LinkedIn</a></td>
{{ end }}
</tr>
<tr>
{{ if ne .Site.Data.personalize.Resume "" }}
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>

View File

@ -0,0 +1,6 @@
{{ if and (isset . "url") ( ne .url "") }}
<tr>
<td><i class="fab fa-{{ lower .name }}" aria-hidden="true"></i></td>
<td>&nbsp;<a href="{{ url }}" target="_blank">{{ .name }}</a></td>
</tr>
{{ end }}