Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog category updates #435

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion _includes/blog_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,22 @@ <h3 class="l-sidebar__heading">Latest posts</h3>
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
<p>See all posts in the <a href="/blog/archive/">archive</a> or <a href="/blog/categoryview">browse by category</a>!</p>
<p>See all posts in the <a href="/blog/archive/">archive</a> <!-- or <a href="/blog/categoryview">browse by category</a>!--></p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks 👍

<h3 class="l-sidebar__heading">Browse by category</h3>
{% assign categories = site.categories | sort %}
<ul class="list list--none">
{% for category in categories %}
{% if category[0] != 'blog' %}
<span class="site-tag">
<li>
<a href="/blog/categoryview/#{{ category | first | slugify }}">
{{ category[0] | replace:'-', ' ' }} ({{ category | last | size }})
</a>
</li>
</span>
{% endif %}
{% endfor %}
</ul>
</div>
<section>
<h3 class="l-sidebar__heading">Latest tweets</h3>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>{{ page.title }}</h1>
<span class="lowercase">and</span>
{% else %}
{% if forloop.first == false %}
,
<span class="cat-comma">, </span>
{% endif %}
{% endif %}
{% if category == 'blog' %}
Expand Down
4 changes: 4 additions & 0 deletions assets/stylesheets/blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,7 @@
width: 200px
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comma thing is a little too much of a hack, so I would remove it 😅 and just hope we can figure out how to fix it in the future. I also don't think we have the use case very often where a blog post will belong to more than two categories. I really appreciate the effort, Chris!

.cat-comma {
margin-left: -2px;
}