Skip to content

Commit 636bc57

Browse files
authored
update the post layout
1 parent af14162 commit 636bc57

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

_layouts/post.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: default
3+
---
4+
5+
{{ content }}
6+
7+
<div class="gh-post-navigation">
8+
{% if page.previous %}
9+
<a class="gh-post-previous" href="{{ page.previous.url }}">&larr; Previous Post: {{ page.previous.title }}</a>
10+
{% endif %}
11+
12+
{% if page.next %}
13+
<a class="gh-post-next" href="{{ page.next.url }}">Next Post: {{ page.next.title }} &rarr;</a>
14+
{% endif %}
15+
</div>

css/main.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,38 @@ p>img{
352352
}
353353

354354

355+
/* Post navigation */
356+
.gh-post-navigation {
357+
margin-top: 3rem;
358+
padding-top: 1.5rem;
359+
border-top: 1px solid var(--border-color);
360+
display: flex;
361+
justify-content: space-between;
362+
flex-wrap: wrap;
363+
gap: 1rem;
364+
}
365+
366+
.gh-post-previous,
367+
.gh-post-next {
368+
color: var(--link-color);
369+
text-decoration: none;
370+
font-weight: 500;
371+
}
372+
373+
.gh-post-previous {
374+
margin-right: auto;
375+
}
376+
377+
.gh-post-next {
378+
margin-left: auto;
379+
}
380+
381+
.gh-post-previous:hover,
382+
.gh-post-next:hover {
383+
text-decoration: underline;
384+
}
385+
386+
355387
/* Search box */
356388
.search-form {
357389
display: flex;

0 commit comments

Comments
 (0)