Skip to content

Commit a8d5300

Browse files
committed
update pinned post styling
1 parent 6bf691c commit a8d5300

File tree

6 files changed

+516
-527
lines changed

6 files changed

+516
-527
lines changed

_pages/books.md

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,34 @@ title: "Books"
44
permalink: /books/
55
---
66

7-
<div class="post-list">
8-
<!-- Pinned book posts first -->
9-
{% assign pinned_book_posts = site.posts | where: "pinned", true | where_exp: "post", "post.tags contains 'books'" %}
10-
{% for post in pinned_book_posts %}
11-
<article class="pinned-post">
12-
<span class="pinned-label">📌</span>
13-
<small>
14-
Published: {{ post.date | date_to_string }}
15-
{% if post.updated %}
16-
<br><span class="updated-date">Updated: {{ post.updated | date_to_string }}</span>
17-
{% endif %}
18-
</small>
19-
<h2><a href="{{ post.url }}">{{ post.title | markdownify | remove: '<p>' | remove: '</p>' }}</a></h2>
20-
<p>{{ post.excerpt }}</p>
21-
{% if post.tags.size > 0 %}
22-
<div class="post-tags">
23-
{% for tag in post.tags %}
24-
<a href="{{site.baseurl}}/archive.html#{{tag | slugize}}" class="post-tag">#{{ tag }}</a>
25-
{% endfor %}
26-
</div>
27-
{% endif %}
28-
</article>
29-
{% endfor %}
7+
<!-- Pinned book posts first -->
8+
{% assign pinned_book_posts = site.posts | where: "pinned", true | where_exp: "post", "post.tags contains 'books'" %}
9+
{% for post in pinned_book_posts %}
10+
<article class="pinned-post">
11+
<span class="pinned-label">📌</span>
12+
<h2><a href="{{ post.url }}">{{ post.title | markdownify | remove: '<p>' | remove: '</p>' }}</a></h2>
13+
<p>{{ post.excerpt }}</p>
14+
</article>
15+
{% endfor %}
3016

3117
<!-- Regular book posts (excluding pinned ones) -->
32-
{% assign regular_book_posts = site.posts | where: "pinned", nil | where_exp: "post", "post.tags contains 'books'" %}
33-
{% for post in regular_book_posts %}
34-
<article>
35-
<small>
36-
Published: {{ post.date | date_to_string }}
37-
{% if post.updated %}
38-
<br><span class="updated-date">Updated: {{ post.updated | date_to_string }}</span>
39-
{% endif %}
40-
</small>
41-
<h2><a href="{{ post.url }}">{{ post.title | markdownify | remove: '<p>' | remove: '</p>' }}</a></h2>
42-
<p>{{ post.excerpt }}</p>
43-
{% if post.tags.size > 0 %}
44-
<div class="post-tags">
45-
{% for tag in post.tags %}
46-
<a href="{{site.baseurl}}/archive.html#{{tag | slugize}}" class="post-tag">#{{ tag }}</a>
47-
{% endfor %}
48-
</div>
18+
{% assign regular_book_posts = site.posts | where_exp: "post", "post.tags contains 'books' and post.pinned != true" %}
19+
{% for post in regular_book_posts %}
20+
<article>
21+
<small>
22+
Published: {{ post.date | date_to_string }}
23+
{% if post.updated %}
24+
<br><span class="updated-date">Updated: {{ post.updated | date_to_string }}</span>
4925
{% endif %}
50-
</article>
51-
{% endfor %}
52-
</div>
26+
</small>
27+
<h2><a href="{{ post.url }}">{{ post.title | markdownify | remove: '<p>' | remove: '</p>' }}</a></h2>
28+
<p>{{ post.excerpt }}</p>
29+
{% if post.tags.size > 0 %}
30+
<div class="post-tags">
31+
{% for tag in post.tags %}
32+
<a href="{{site.baseurl}}/archive.html#{{tag | slugize}}" class="post-tag">#{{ tag }}</a>
33+
{% endfor %}
34+
</div>
35+
{% endif %}
36+
</article>
37+
{% endfor %}

_site/assets/main.css

Lines changed: 19 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)