add functionality to display categories, like tags, in blog home page (#1482)
Added the functionality to display categories on the front page of the blog, just like tags.
This commit is contained in:
parent
aeee609c92
commit
4d955518bb
|
|
@ -263,6 +263,7 @@ jekyll-archives:
|
|||
category: '/blog/category/:name/'
|
||||
|
||||
display_tags: ['formatting', 'images', 'links', 'math', 'code'] # these tags will be displayed on the front page of your blog
|
||||
display_categories: ['blockquotes'] # these categories will be displayed on the front page of your blog
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Jekyll Scholar
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ footer.sticky-bottom {
|
|||
}
|
||||
}
|
||||
|
||||
.tag-list {
|
||||
.tag-category-list {
|
||||
border-bottom: 1px solid var(--global-divider-color);
|
||||
text-align: center;
|
||||
padding-top: 1rem;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ pagination:
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if site.display_tags %}
|
||||
<div class="tag-list">
|
||||
{% if site.display_tags or site.display_categories %}
|
||||
<div class="tag-category-list">
|
||||
<ul class="p-0 m-0">
|
||||
{% for tag in site.display_tags %}
|
||||
<li>
|
||||
|
|
@ -36,6 +36,17 @@ pagination:
|
|||
<p>•</p>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
{% if site.display_categories.size > 0 and site.display_tags.size > 0 %}
|
||||
<p>•</p>
|
||||
{% endif %}
|
||||
{% for category in site.display_categories %}
|
||||
<li>
|
||||
<i class="fas fa-tag fa-sm"></i> <a href="{{ category | slugify | prepend: '/blog/category/' | relative_url }}">{{ category }}</a>
|
||||
</li>
|
||||
{% unless forloop.last %}
|
||||
<p>•</p>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue