Skip to content

Commit e3d7b32

Browse files
committed
update post links layout
1 parent 22906e8 commit e3d7b32

File tree

4 files changed

+51
-69
lines changed

4 files changed

+51
-69
lines changed

blog.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
---
44
<h2>Posts</h2>
55

6-
<ul class="post-list">
7-
{% for post in site.categories.blog %}
8-
<li>
9-
<h3>
10-
<span class="post-meta post-first-col">{{ post.date | date: "%b %-d, %Y" }}</span> <a class="post-link"
11-
href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
12-
</h3>
13-
</li>
14-
{% endfor %}
15-
</ul>
6+
{% for post in site.categories.blog %}
7+
<div class="post">
8+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
9+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
10+
</div>
11+
{% endfor %}

css/main.css

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ footer {
7070
width: 100%;
7171
padding: 2ch;
7272
text-align: center;
73-
margin-top: 1rem;
73+
margin-top: 3rem;
7474
box-shadow: 0 0 7px rgba(0, 0, 0, 0.15);
7575
}
7676

@@ -153,36 +153,30 @@ a.source:hover {
153153
}
154154

155155

156-
.post-list {
157-
margin-left: 0;
158-
list-style: none;
156+
.post {
157+
margin: 0 0 1.5rem 0;
159158
}
160159

161-
.post-list > li {
162-
margin-top: 2rem;
160+
.post .post-date {
161+
font-size: 1.25rem;
162+
color: #666666;
163+
font-weight: 300;
163164
}
164165

165-
.post-list h2 {
166-
margin-top: 0;
166+
.post .post-link {
167167
font-size: 2rem;
168+
line-height: 3rem;
169+
font-weight: 400;
168170
}
169171

170-
.post-meta {
171-
color: #666666;
172-
font-weight: 300;
173-
}
174-
175-
/* Help me! I know there should be some subgrid magic to align these spans... */
176-
.post-first-col {
177-
display: inline-block;
178-
width: 16rem;
172+
.all-posts-link {
173+
font-size: 1.4rem;
179174
}
180175

181-
.post-link {
182-
font-weight: 400;
176+
.post .post-link, .all-posts-link {
183177
text-decoration: none;
184178
}
185179

186-
.post-link:hover {
180+
.post .post-link:hover, .all-posts-link:hover {
187181
text-decoration: underline;
188182
}

index.html

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>About</h2>
2727
</p>
2828

2929
<p>Note that the project is in <strong>alpha</strong> status: it is already
30-
useful in practice, but can't be considered stable.</p>
30+
useful in practice, but can't be considered stable.</p>
3131
</section>
3232

3333
<section class="paragraph lead">
@@ -71,44 +71,40 @@ <h2>Support</h2>
7171
<p>
7272
The following companies contributed significantly towards rust-analyzer development:
7373

74-
<div class="sponsors">
75-
<ul>
76-
<li><a href="https://ferrous-systems.com/">Ferrous Systems</a></li>
77-
<li><a href="https://www.mozilla.org/">Mozilla</a></li>
78-
</ul>
79-
<ul>
80-
<li><a href="https://embark-studios.com">Embark Studios</a></li>
81-
<li><a href="https://www.freiheit.com/">freiheit.com</a></li>
82-
</ul>
83-
</div>
74+
<div class="sponsors">
75+
<ul>
76+
<li><a href="https://ferrous-systems.com/">Ferrous Systems</a></li>
77+
<li><a href="https://www.mozilla.org/">Mozilla</a></li>
78+
</ul>
79+
<ul>
80+
<li><a href="https://embark-studios.com">Embark Studios</a></li>
81+
<li><a href="https://www.freiheit.com/">freiheit.com</a></li>
82+
</ul>
83+
</div>
8484
</p>
8585

8686
</section>
8787

8888
<section>
89-
<h2><span class="post-first-col">Latest News</span> <a class="post-link" href="/thisweek">All</a></h2>
89+
<h2><span class="post-first-col">Latest News</span></h2>
9090

91-
<ul class="post-list">
91+
<div class="post">
9292
{% assign post = site.categories.thisweek.first %}
93-
<li>
94-
<h3>
95-
<span class="post-meta post-first-col">{{ post.date | date: "%b %-d, %Y" }}</span>
96-
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
97-
</h3>
98-
</li>
99-
</ul>
93+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
94+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
95+
</div>
96+
97+
<a class="all-posts-link" href="/thisweek">All news</a>
10098
</section>
10199

102100
<section>
103-
<h2><span class="post-first-col">Latest Post</span> <a class="post-link" href="/blog">All</a></h2>
101+
<h2><span class="post-first-col">Latest Post</span></h2>
104102

105-
<ul class="post-list">
103+
<div class="post">
106104
{% assign post = site.categories.blog.first %}
107-
<li>
108-
<h3>
109-
<span class="post-meta post-first-col">{{ post.date | date: "%b %-d, %Y" }}</span>
110-
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
111-
</h3>
112-
</li>
113-
</ul>
105+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
106+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
107+
</div>
108+
109+
<a class="all-posts-link" href="/blog">All posts</a>
114110
</section>

thisweek.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
---
44
<h2>This Week In rust-analyzer</h2>
55

6-
<ul class="post-list">
7-
{% for post in site.categories.thisweek %}
8-
<li>
9-
<h3>
10-
<span class="post-meta post-first-col">{{ post.date | date: "%b %-d, %Y" }}</span> <a class="post-link"
11-
href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
12-
</h3>
13-
</li>
14-
{% endfor %}
15-
</ul>
6+
{% for post in site.categories.thisweek %}
7+
<div class="post">
8+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
9+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
10+
</div>
11+
{% endfor %}

0 commit comments

Comments
 (0)