diff options
author | digitalcraftsman <digitalcraftsman@protonmail.com> | 2017-05-19 23:34:25 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@protonmail.com> | 2017-05-19 23:34:25 +0300 |
commit | b6b79b766386db444df1703dd295a87acd5f6157 (patch) | |
tree | c7cc9cb1a1259d760c4654ff7244e257d001e9b7 | |
parent | 0928ac7868816f52541d07a2a66a4038c54de344 (diff) |
Add Gravatar as alternative for profile picture
Closes #51
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/partials/profile.html | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ee11f32..8c9f2bc 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -25,6 +25,9 @@ themesDir = "../.." site_description = "" copyright = "Powered by [Hugo](//gohugo.io). Theme by [PPOffice](http://github.com/ppoffice)." avatar = "css/images/avatar.png" + # Enter your email address to display your Gravatar icon in the profile. If not set the theme + # will fallback to the avatar. + gravatar = "you@example.com" logo = "css/images/logo.png" disable_mathjax = false # set to true to disable MathJax diff --git a/layouts/partials/profile.html b/layouts/partials/profile.html index 8b4089c..0b42087 100644 --- a/layouts/partials/profile.html +++ b/layouts/partials/profile.html @@ -1,7 +1,11 @@ <aside id="profile"> <div class="inner profile-inner"> <div class="base-info profile-block"> + {{ with .Site.Params.gravatar }} + <img id="avatar" src="https://www.gravatar.com/avatar/{{ . | md5 }}?s=100&d=identicon"/> + {{ else }} <img id="avatar" src="{{ .Site.Params.avatar | absURL }}"> + {{ end }} {{ with .Site.Params.author}}<h2 id="name">{{ . }}</h2>{{ end }} {{ with .Site.Params.bio }}<h3 id="title">{{ . }}</h3>{{ end }} {{ with .Site.Params.location }}<span id="location"><i class="fa fa-map-marker"></i>{{ . }}</span>{{ end }} |