Skip to content

Commit

Permalink
Make posts category info separate, archive more automatic.
Browse files Browse the repository at this point in the history
  • Loading branch information
petrroll committed Jul 10, 2020
1 parent f87e1bb commit 6e19339
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ exclude:
- README.md
- CNAME

collections:
- posts_category_info
11 changes: 6 additions & 5 deletions _includes/archive-category.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% comment %} Assumes `category_info` variable containing `.name` and `.description`. {% endcomment %}
<div class="archive-group">
<div id="#{{ category_name | slugize }}"></div>
<div id="#{{ category_info.name | slugize }}"></div>
<p></p>
<h2 class="category-head">{{ category_name | capitalize }}</h2>
<a name="{{ category_name | slugize }}"></a>
{{category_desc}}
<h2 class="category-head">{{ category_info.name | capitalize }}</h2>
<a name="{{ category_info.name | slugize }}"></a>
{{category_info.description}}
{% capture curr_date %}first-entry{% endcapture %}
<div class="group-year">
<ul>
{% for post in site.categories[category_name] %}
{% for post in site.categories[category_info.name] %}
{% capture post_date %}{{ post.date | date: "%b, %Y" }}{% endcapture %}
{% unless curr_date == post_date %}
{% unless curr_date == "first-entry" %}
Expand Down
4 changes: 4 additions & 0 deletions _posts_category_info/01_papers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: papers
description: "Notes written down while reading and trying to understand random ML/SWE/CS papers. Originally not intended for the eyes of other people and therefore possibly incomprehensible and/or flat out wrong."
---
4 changes: 4 additions & 0 deletions _posts_category_info/02_misc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: misc
description: "Various random content I thought might be interesting."
---
10 changes: 3 additions & 7 deletions archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
---

<div id="archives">
{% capture category_name %}papers{% endcapture %}
{% capture category_desc %}Notes written down while reading and trying to understand random ML/SWE/CS papers. Originally not intended for the eyes of other people and therefore possibly incomprehensible and/or flat out wrong. {% endcapture %}
{% include archive-category.html %}

{% capture category_name %}misc{% endcapture %}
{% capture category_desc %}Various random content I thought might be interesting. {% endcapture %}
{% include archive-category.html %}
{% for category_info in site.posts_category_info %}
{% include archive-category.html %}
{% endfor %}
</div>

0 comments on commit 6e19339

Please sign in to comment.