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 # Supports markdown
About = "" About = ""
# Add only the handle
Github = ""
Twitter = ""
# Add the absolute links
Goodreads = ""
Linkedin = ""
Email = "" Email = ""
# Add the filename with file extension. # Add the filename with file extension.
@ -18,3 +10,19 @@ Resume = ""
# Sets the number of posts to display on the front page # Sets the number of posts to display on the front page
PostLimit = 4 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> <h4>{{ .Site.Data.personalize.About| markdownify }}</h4>
<table> <table>
<tr> {{ range .Site.Data.personalize.profiles }}
{{ if ne .Site.Data.personalize.Github "" }} {{ partial "profile_link.html" . }}
<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>
{{ end }} {{ 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> <tr>
{{ if ne .Site.Data.personalize.Resume "" }} {{ if ne .Site.Data.personalize.Resume "" }}
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td> <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 }}