aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-24 13:07:09 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-24 13:07:09 +0300
commit5c569ca60837f88d96df6429cfe687c55792b138 (patch)
tree92aea3d0eee1f77335557479cdfb1b11520e4c02
parentnotes: reformat, add subtitles (diff)
downloadblog-5c569ca60837f88d96df6429cfe687c55792b138.tar.gz
blog-5c569ca60837f88d96df6429cfe687c55792b138.zip
show notes on the sidebar on some pages
Diffstat (limited to '')
-rw-r--r--_config.yml2
-rw-r--r--_includes/custom-sidebar.html8
-rw-r--r--_includes/notes.html19
-rw-r--r--all/index.html5
-rw-r--r--index.html5
-rw-r--r--notes/index.html12
6 files changed, 38 insertions, 13 deletions
diff --git a/_config.yml b/_config.yml
index 47ed813..f8a9e84 100644
--- a/_config.yml
+++ b/_config.yml
@@ -53,7 +53,7 @@ repository: egor-tensin/blog
# jekyll-paginate
paginate: 10
# jekyll-remote-theme
-remote_theme: egor-tensin/jekyll-theme@7a358a1407e8b32cd36ebd85295099340557151f
+remote_theme: egor-tensin/jekyll-theme@5e25c497c37c39d399d0851f316aa5783d536347
# Theme settings
settings:
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>&nbsp;{{ 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>
diff --git a/all/index.html b/all/index.html
index b3aa9de..3a0a88d 100644
--- a/all/index.html
+++ b/all/index.html
@@ -4,5 +4,10 @@ layout: default
navbar:
link: Archive
priority: 2
+sidebar:
+ latest_posts:
+ hide: true
+ notes:
+ show: true
---
{% include jekyll-theme/categories/all.html %}
diff --git a/index.html b/index.html
index 61d0c58..8fc200a 100644
--- a/index.html
+++ b/index.html
@@ -6,6 +6,9 @@ navbar:
priority: 1
paginated: true
sidebar:
- hide: true
+ latest_posts:
+ hide: true
+ notes:
+ show: true
---
{% include jekyll-theme/posts/feed.html %}
diff --git a/notes/index.html b/notes/index.html
index da03827..1351be1 100644
--- a/notes/index.html
+++ b/notes/index.html
@@ -5,18 +5,8 @@ navbar:
priority: 3
---
{% if site.notes.size > 0 %}
- {% comment %}
- Sorting can be done in _config.yml with Jekyll 4.0 or later.
- {% endcomment %}
- {% assign note_list = site.notes | sort_natural: 'title' %}
<p>Style guides and best practices, not worthy of a post.</p>
- <div class="list-group wide-enough">
- {% for note in note_list %}
- <a href="{{ note.url | relative_url }}" class="list-group-item">
- <h4 class="list-group-item-heading">{{ note.title }} <small>{{ note.subtitle }}</small></h4>
- </a>
- {% endfor %}
- </div>
+ {% include notes.html %}
{% else %}
<p>Sorry, no notes have been added yet.</p>
{% endif %}