diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-11-06 23:49:15 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-11-06 23:49:15 +0100 |
commit | 713aa48f60d337743917fd21347594561eef377b (patch) | |
tree | 3907999ed8adaeb909bb886f0d26628a7b488634 | |
parent | posts: adjust margin after feed (diff) | |
download | jekyll-theme-713aa48f60d337743917fd21347594561eef377b.tar.gz jekyll-theme-713aa48f60d337743917fd21347594561eef377b.zip |
sidebar: split "about" and "links" into different includes
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | _includes/jekyll-theme/sidebar.html | 1 | ||||
-rw-r--r-- | _includes/jekyll-theme/sidebar/about.html | 14 | ||||
-rw-r--r-- | _includes/jekyll-theme/sidebar/links.html | 21 |
4 files changed, 25 insertions, 17 deletions
@@ -114,9 +114,9 @@ Hide the link by setting `site.settings.navbar.github` to `false`. Hide the sidebar by setting either `site.settings.sidebar.hide` or `page.sidebar.hide` to `true`. -The sidebar includes two entries by default: "About" and "Latest posts". -Hide them individually by setting `sidebar.{about,latest_posts}.hide` to `true` -(under either `site.settings` or `page`). +The sidebar includes 3 entries by default: "latest posts", "about" and "links". +Hide them individually by setting `sidebar.{latest_posts,about,links}.hide` to +`true` (under either `site.settings` or `page`). Add content to the sidebar by putting it in your _includes/custom-sidebar.html. diff --git a/_includes/jekyll-theme/sidebar.html b/_includes/jekyll-theme/sidebar.html index 2ffe91b..5bcda66 100644 --- a/_includes/jekyll-theme/sidebar.html +++ b/_includes/jekyll-theme/sidebar.html @@ -3,5 +3,6 @@ {% include jekyll-theme/sidebar/latest-posts.html %} {% include custom-sidebar.html %} {% include jekyll-theme/sidebar/about.html %} + {% include jekyll-theme/sidebar/links.html %} </div> {% endunless %} diff --git a/_includes/jekyll-theme/sidebar/about.html b/_includes/jekyll-theme/sidebar/about.html index 9ea927c..4d3787e 100644 --- a/_includes/jekyll-theme/sidebar/about.html +++ b/_includes/jekyll-theme/sidebar/about.html @@ -20,20 +20,6 @@ <p class="list-group-item-text">{{ project_desc }}</p> </div> </div> - -<div class="list-group wide-enough"> - <div class="list-group-item disabled"> - <h4 class="list-group-item-heading">links</h4> - </div> - {% if site.github %} - {% assign github_link = site.settings.navbar.github.link | default: 'GitHub' %} - {% assign github_icon = site.settings.navbar.github.icon | default: 'globe' %} - {% capture github_icon %}<span class="glyphicon glyphicon-{{ github_icon }}"></span> {% endcapture %} - <a class="list-group-item" href="{{ site.github.repository_url }}" target="_blank">{{ github_icon }}{{ github_link }}</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> {% endcapture %} {% include jekyll-theme/sidebar/entry.html content=about_content %} diff --git a/_includes/jekyll-theme/sidebar/links.html b/_includes/jekyll-theme/sidebar/links.html new file mode 100644 index 0000000..1b56467 --- /dev/null +++ b/_includes/jekyll-theme/sidebar/links.html @@ -0,0 +1,21 @@ +{% unless site.settings.sidebar.links.hide or page.sidebar.links.hide %} + +{% capture links_content %} +<div class="list-group wide-enough"> + <div class="list-group-item disabled"> + <h4 class="list-group-item-heading">links</h4> + </div> + {% if site.github %} + {% assign github_link = site.settings.navbar.github.link | default: 'GitHub' %} + {% assign github_icon = site.settings.navbar.github.icon | default: 'globe' %} + {% capture github_icon %}<span class="glyphicon glyphicon-{{ github_icon }}"></span> {% endcapture %} + <a class="list-group-item" href="{{ site.github.repository_url }}" target="_blank">{{ github_icon }}{{ github_link }}</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> +{% endcapture %} + +{% include jekyll-theme/sidebar/entry.html content=links_content %} + +{% endunless %} |