diff options
author | Jordan Kohl <j7kohl@gmail.com> | 2017-12-04 02:30:39 +0300 |
---|---|---|
committer | Jordan Kohl <j7kohl@gmail.com> | 2017-12-04 02:30:39 +0300 |
commit | a51dd08eafa3d663a16c308c852de979c5cb8d30 (patch) | |
tree | e93f6e96fa909560d64c62cba95da18afd6ea9ee | |
parent | 06811c8dd52901e801e514eac94eeec129596418 (diff) |
Add optional Stack Overflow link to sidebar via site params
If a Stack Overflow ID is included in the site params, a link to the user's SO profile will be displayed. Uses the SO fontawesome icon.
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | layouts/partials/sidebar.html | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -26,11 +26,12 @@ disqusShortname = "xxxx" [params] twitterName = "dragos_plesca" githubName = "dplesca" + stackOverflowId = "#######" description = "Demo site for a hugo theme" google_analytics = "UA-xxxxxx-xx" ``` -Notice the configuration necessary for disqus comments (just setting the disqusShortname), the twitter and github handlers (for the site sidebar), the site description and enabling Google Analytics reporting. +Notice the configuration necessary for disqus comments (just setting the disqusShortname); the twitter, github, and stack overflow handlers (for the site sidebar); the site description and enabling Google Analytics reporting. ### Syntax Highlighting diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 0d123ce..01b1bb2 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -17,6 +17,11 @@ <a class="pure-button" href="https://github.com/{{ . }} "><i class="fa fa-github-alt"></i> github</a> </li> {{ end }} + {{ with .Site.Params.stackOverflowId }} + <li class="nav-item"> + <a class="pure-button" href="https://stackoverflow.com/u/{{ . }} "><i class="fa fa-stack-overflow"></i> Stack Overflow</a> + </li> + {{ end }} <li class="nav-item"> <a class="pure-button" href="{{ .Site.BaseURL }}/index.xml"><i class="fa fa-rss"></i> rss</a> </li> |