Skip to content

Commit

Permalink
+(fix) Post List number bullet point was not incrementing each post
Browse files Browse the repository at this point in the history
  • Loading branch information
CalGrimes committed Jun 27, 2021
1 parent 02f3c11 commit c029f24
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
Binary file modified .vs/CalGrimes-Blog-Postings/v16/.suo
Binary file not shown.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
29 changes: 18 additions & 11 deletions _includes/postslist.njk
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<ol reversed class="postlist" style="counter-reset: start-from {{ (postslistCounter or postslist.length) + 1 }}">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url | url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
{% for tag in post.data.tags | filterTagList %}
{% set tagUrl %}/tags/{{ tag | slug }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{% endfor %}
</li>
{% endfor %}
<ol reversed="reversed" class="postlist" style="counter-reset: start-from {{ (postslistCounter or postslist.length) + 1 }}">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url | url }}" class="postlist-link">
{% if post.data.title %}{{ post.data.title }}
{% else %}
<code>{{ post.url }}</code>
{% endif %}
</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
{% for tag in post.data.tags | filterTagList %}
{%- if collections.tagList.indexOf(tag) != -1 -%}
{% set tagUrl %}/tags/{{ tag }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{%- endif -%}
{% endfor %}
</li>
{% endfor %}
</ol>
4 changes: 4 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ footer > .container {
padding: 0;
}

.postlist-item {
counter-increment: start-from -1;
}

.postlist-item:before {
display: inline-block;
pointer-events: none;
Expand Down

0 comments on commit c029f24

Please sign in to comment.