diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-24 13:07:09 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-24 13:07:09 +0300 |
commit | 5c569ca60837f88d96df6429cfe687c55792b138 (patch) | |
tree | 92aea3d0eee1f77335557479cdfb1b11520e4c02 /_includes | |
parent | notes: reformat, add subtitles (diff) | |
download | blog-5c569ca60837f88d96df6429cfe687c55792b138.tar.gz blog-5c569ca60837f88d96df6429cfe687c55792b138.zip |
show notes on the sidebar on some pages
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/custom-sidebar.html | 8 | ||||
-rw-r--r-- | _includes/notes.html | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/_includes/custom-sidebar.html b/_includes/custom-sidebar.html new file mode 100644 index 0000000..3bd83aa --- /dev/null +++ b/_includes/custom-sidebar.html @@ -0,0 +1,8 @@ +{% if page.sidebar.notes.show %} + +{% capture notes %} +{% include notes.html sidebar=true %} +{% endcapture %} +{% include jekyll-theme/sidebar/entry.html header='Notes' content=notes %} + +{% endif %} diff --git a/_includes/notes.html b/_includes/notes.html new file mode 100644 index 0000000..25c8049 --- /dev/null +++ b/_includes/notes.html @@ -0,0 +1,19 @@ +{% comment %} + Sorting can be done in _config.yml with Jekyll 4.0 or later. +{% endcomment %} +{% assign note_list = site.notes | sort_natural: 'title' %} +<div class="list-group wide-enough"> + {% for note in note_list %} + <a href="{{ note.url | relative_url }}" class="list-group-item"> + {% if include.sidebar %} + <span class="badge">{{ note.subtitle }}</span> + <span class="glyphicon glyphicon-file"></span> {{ note.title }} + {% else %} + <h5 class="list-group-item-heading" style="display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-grap: .5em;"> + <span>{{ note.title }}</span> + <small>{{ note.subtitle }}</small> + </h5> + {% endif %} + </a> + {% endfor %} +</div> |