Skip to content

Commit cf928fc

Browse files
authored
Merge pull request #603 from shift72/posts-tweaks
small style changes for posts feed / post page
2 parents aef8eb8 + 67eb0d6 commit cf928fc

5 files changed

Lines changed: 38 additions & 18 deletions

File tree

site/styles/_posts.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,24 @@
8888
}
8989
}
9090

91+
.post-page .post,
92+
.posts-feed-page .post-preview {
93+
background-color: var(--post-background-color);
94+
padding: 20px 25px;
95+
border-radius: 8px;
96+
}
97+
9198
.post-page {
99+
.page-bg {
100+
filter: blur(8px);
101+
-webkit-filter: blur(8px);
102+
}
103+
.post {
104+
margin: 1rem 0;
105+
}
92106
comment-section {
93107
padding: 0;
94-
margin-top: 3rem;
108+
margin-top: 2rem;
95109
}
96110
}
97111

@@ -102,6 +116,7 @@
102116

103117
.post-preview-show-more {
104118
text-align: center;
119+
text-decoration: underline;
105120
opacity: 0.8;
106121
}
107122

@@ -110,6 +125,7 @@
110125
overflow: hidden;
111126

112127
.post-body {
128+
margin-bottom: 40px;
113129
max-height: var(--post-preview-height);
114130
}
115131

@@ -132,8 +148,6 @@
132148
display: flex;
133149
justify-content: space-between;
134150
margin-top: 4rem;
135-
padding-top: 2rem;
136-
border-top: 1px solid #fff5;
137151

138152
.posts-pagination-next {
139153
margin-left: auto;

site/styles/_variables.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@
142142

143143
--page-reading-column-width: 69ch;
144144

145-
--posts-feed-spacing: 6rem;
146-
--post-preview-height: 300px;
145+
--posts-feed-spacing: 3rem;
146+
--post-preview-height: 250px;
147+
--post-background-color: #030303a0;
147148

148149
--post-body-font-weight: 400;
149150
--post-body-line-height: 1.55;

site/templates/page/post.jet

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{{block body()}}
1111
<main id="main" class="page post-page">
1212
{{yield backgroundImage(containerClass="page-bg", gradientClass="right-gradient", imageClass="page-bg-img", imageSrc=page.Images.Background)}}
13-
14-
<div class="post">
13+
{{yield postBacktoPostsLink()}}
14+
<div class="post">
1515
{{yield postTitle(post=page)}}
1616
{{yield postMeta(post=page)}}
1717
{{yield postHeaderImage(post=page)}}
@@ -21,9 +21,6 @@
2121
{{if isEnabled("commenting")}}
2222
<comment-section slug="{{page.Slug}}"></comment-section>
2323
{{end}}
24+
{{yield postBacktoPostsLink()}}
2425
</main>
2526
{{end}}
26-
27-
28-
29-
{{block appBadges()}}{{end}}

site/templates/page/post/posts-feed.jet

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
{{range page := pages}}
99
{{yield postPreview(post=page)}}
1010
{{end}}
11-
12-
<div class="posts-pagination">
13-
{{ if len(pagination.PreviousURL) > 0 }}
14-
<a class="posts-pagination-prev" href="{{pagination.PreviousURL}}">{{i18n("posts_pagination_prev")}}</a>
15-
{{end}}
16-
{{ if len(pagination.NextURL) > 0 }}
17-
<a class="posts-pagination-next" href="{{pagination.NextURL}}">{{i18n("posts_pagination_next")}}</a>
11+
{{ if len(pagination.PreviousURL) > 0 || len(pagination.NextURL) > 0 }}
12+
<div class="posts-pagination">
13+
{{ if len(pagination.PreviousURL) > 0 }}
14+
<a class="posts-pagination-prev" href="{{pagination.PreviousURL}}">{{i18n("posts_pagination_prev")}}</a>
15+
{{end}}
16+
{{ if len(pagination.NextURL) > 0 }}
17+
<a class="posts-pagination-next" href="{{pagination.NextURL}}">{{i18n("posts_pagination_next")}}</a>
18+
{{end}}
19+
</div>
1820
{{end}}
1921
</main>
2022

site/templates/page/post/shared.jet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@
3232
{{text | raw}}
3333
</div>
3434
{{end}}
35+
36+
{{block postBacktoPostsLink()}}
37+
<div class="post-back-to-posts">
38+
<a href="{{routeToPath("/posts/")}}">{{i18n("post_back_to_posts")}}</a>
39+
</div>
40+
{{end}}

0 commit comments

Comments
 (0)