diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-11-04 19:32:06 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-11-05 13:01:33 +0300 |
commit | ea2cac77bbb0b01b42e4c50acf733056141fcd83 (patch) | |
tree | 22af069250b139c541dfbd3b3d62c73ca6a94843 /_includes/common/sidebar.html | |
parent | README: fix a typo (diff) | |
download | jekyll-theme-ea2cac77bbb0b01b42e4c50acf733056141fcd83.tar.gz jekyll-theme-ea2cac77bbb0b01b42e4c50acf733056141fcd83.zip |
pick up default site.settings values from site.github
Also, use the default filter more, it's much more convenient.
Diffstat (limited to '_includes/common/sidebar.html')
-rw-r--r-- | _includes/common/sidebar.html | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/_includes/common/sidebar.html b/_includes/common/sidebar.html index 6d1d17d..929cabe 100644 --- a/_includes/common/sidebar.html +++ b/_includes/common/sidebar.html @@ -1,10 +1,23 @@ <div class="row"> <div class="col-xs-12 col-sm-6 col-md-12"> <h4>About</h4> - <p>{{ site.settings.project.description }}. Feel free to contribute or contact me.</p> + {% assign project_desc = site.settings.project.description %} + {% unless project_desc %} + {% if site.github %} + {% assign project_desc = site.github.project_tagline %} + {% endif %} + {% endunless %} + {% if project_desc %} + {% capture project_desc %}{{ project_desc }}. {% endcapture %} + {% endif %} + {% capture project_desc %}{{ project_desc }}Feel free to contribute or contact me.{% endcapture %} + <p>{{ project_desc }}</p> <div class="list-group wide-enough"> + {% if site.github %} <a class="list-group-item" href="{{ site.github.repository_url }}"><span class="glyphicon glyphicon-home"></span> GitHub repository</a> - <a class="list-group-item" href="mailto:{{ site.settings.author.email }}"><span class="glyphicon glyphicon-envelope"></span> {{ site.settings.author.email }}</a> + {% endif %} + {% assign author_email = site.settings.author.email | default: 'John.Doe@example.com' %} + <a class="list-group-item" href="mailto:{{ author_email }}"><span class="glyphicon glyphicon-envelope"></span> {{ author_email }}</a> </div> </div> <div class="col-xs-12 col-sm-6 col-md-12"> |