Skip to content

Commit 1998680

Browse files
bors[bot]Aloso
andauthored
Merge #64
64: Update post links layout r=Aloso a=Aloso This changes the layout the blog post links. Screenshot of the home page: ![ra1](https://user-images.githubusercontent.com/15658558/90049265-db618400-dcd4-11ea-9c78-74d34fad96ae.png) Screenshot of the blog page: ![ra2](https://user-images.githubusercontent.com/15658558/90049278-df8da180-dcd4-11ea-9a9e-66d9275f7ac0.png) Co-authored-by: Ludwig Stecher <[email protected]>
2 parents 6286043 + 61e9e9e commit 1998680

File tree

4 files changed

+49
-59
lines changed

4 files changed

+49
-59
lines changed

blog.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ <h2>Posts</h2>
55

66
<ul class="post-list">
77
{% 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>
8+
<li class="post">
9+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
10+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
1311
</li>
1412
{% endfor %}
1513
</ul>

css/main.css

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ main {
7474

7575
footer {
7676
width: 100%;
77-
margin-top: 1rem;
77+
margin-top: 3rem;
7878
box-shadow: 0 0 7px rgba(0, 0, 0, 0.15);
7979
}
8080

@@ -147,38 +147,37 @@ a.source:hover {
147147
list-style: none;
148148
}
149149

150-
151150
.post-list {
152-
margin-left: 0;
153-
list-style: none;
151+
margin: 0;
152+
padding: 0;
153+
list-style-type: none;
154154
}
155155

156-
.post-list > li {
157-
margin-top: 2rem;
158-
}
159-
160-
.post-list h2 {
161-
margin-top: 0;
162-
font-size: 2rem;
156+
.post {
157+
margin: 0 0 1.5rem 0;
163158
}
164159

165-
.post-meta {
160+
.post .post-date {
161+
font-size: 1.25rem;
166162
color: #666666;
167163
font-weight: 300;
168164
}
169165

170-
/* Help me! I know there should be some subgrid magic to align these spans... */
171-
.post-first-col {
172-
display: inline-block;
173-
width: 16rem;
166+
.post .post-link {
167+
font-size: 1.7rem;
168+
line-height: 2.4rem;
169+
font-weight: 400;
174170
}
175171

176-
.post-link {
177-
font-weight: 400;
172+
.all-posts-link {
173+
font-size: 1.25rem;
174+
}
175+
176+
.post .post-link, .all-posts-link {
178177
text-decoration: none;
179178
}
180179

181-
.post-link:hover {
180+
.post .post-link:hover, .all-posts-link:hover {
182181
text-decoration: underline;
183182
}
184183

index.html

Lines changed: 25 additions & 30 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">
@@ -70,45 +70,40 @@ <h2>Support</h2>
7070

7171
<p>
7272
The following companies contributed significantly towards rust-analyzer development:
73-
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>
8473
</p>
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>
8584

8685
</section>
8786

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

91-
<ul class="post-list">
90+
<div class="post">
9291
{% 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>
92+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
93+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
94+
</div>
95+
96+
<a class="all-posts-link" href="/thisweek">All news</a>
10097
</section>
10198

10299
<section>
103-
<h2><span class="post-first-col">Latest Post</span> <a class="post-link" href="/blog">All</a></h2>
100+
<h2><span class="post-first-col">Latest Post</span></h2>
104101

105-
<ul class="post-list">
102+
<div class="post">
106103
{% 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>
104+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
105+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
106+
</div>
107+
108+
<a class="all-posts-link" href="/blog">All posts</a>
114109
</section>

thisweek.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ <h2>This Week In rust-analyzer</h2>
55

66
<ul class="post-list">
77
{% 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>
8+
<li class="post">
9+
<div class="post-date">{{ post.date | date: "%b %-d, %Y" }}</div>
10+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
1311
</li>
1412
{% endfor %}
1513
</ul>

0 commit comments

Comments
 (0)