File tree Expand file tree Collapse file tree 4 files changed +30
-20
lines changed Expand file tree Collapse file tree 4 files changed +30
-20
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ github:
3838
3939
4040# ## Navbar Settings ###
41- nav_exclude : # The following paths are excluded from navbar
41+ nav_exclude : # The following paths are excluded from navbar
4242 - pages/tags.html
43+ - pages/calendar.html
4344 - pages/404.html
4445 - pages/index.md
4546
Original file line number Diff line number Diff line change 1- <!-- Group posts by date -->
2- {%- assign posts_by_date = {} -%}
3- {%- for post in site.posts -%}
4- {%- assign post_date = post.date | date: "%Y-%m" -%} <!-- Group by year and month -->
5- {%- if posts_by_date[post_date] == nil -%}
6- {%- assign posts_by_date[post_date] = "" -%}
7- {%- endif -%}
8- {%- assign posts_by_date[post_date] = posts_by_date[post_date] | append: post.url | append: "|" -%}
9- {%- endfor -%}
1+ {%- assign posts_by_date = site.posts | group_by_exp: "post", "post.date | date: '%Y-%m'" -%}
102
113<!-- Create a dropdown list by date -->
12- {% for date, posts in posts_by_date %}
13- < div class ="py-3 ">
14- < h4 id ="{{ date }} "> {{ date }}</ h4 >
15- < button class ="btn btn-primary " type ="button " data-toggle ="collapse " data-target ="#posts-{{ date }} " aria-expanded ="false " aria-controls ="posts-{{ date }} ">
16- Ver posts
17- </ button >
18- < div class ="collapse " id ="posts-{{ date }} ">
4+ {% for group in posts_by_date %}
5+ < div class ="py-0 ">
6+ < h4 class ="date-item ">
7+ < a href ="javascript:void(0) " class ="date-toggle " data-toggle ="collapse " data-target ="#posts-{{ group.name }} " aria-expanded ="false " aria-controls ="posts-{{ group.name }} ">
8+ {{ group.name }}
9+ </ a >
10+ </ h4 >
11+ < div class ="collapse " id ="posts-{{ group.name }} ">
1912 < ol >
20- {% assign post_urls = posts | split: '|' %}
21- {% for post_url in post_urls %}
22- {%- assign post = site.posts | where: "url", post_url | first -%}
13+ {% for post in group.items %}
2314 < li > < a href ="{{ post.url | relative_url }} "> {{ post.title }}</ a > </ li >
2415 < small class ="text-muted "> - {{ post.date | date_to_long_string }}</ small >
2516 < br />
Original file line number Diff line number Diff line change 2424 color : white !important ;
2525 }
2626}
27+
28+ .date-toggle {
29+ cursor : pointer ;
30+ text-decoration : none ;
31+ font-weight : bold ;
32+ color : #007bff ;
33+ }
34+
35+ .date-toggle :hover {
36+ text-decoration : underline ;
37+ }
Original file line number Diff line number Diff line change 1+ ---
2+ layout: page
3+ title: Calendar
4+ permalink: /blog/calendar
5+ ---
6+
7+ {% include blog/calendar.html %}
You can’t perform that action at this time.
0 commit comments