Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit 66b740a

Browse files
committed
templates / layout for news items and archive pages
1 parent c89cb6c commit 66b740a

15 files changed

+674
-81
lines changed

_assets/css/theme.css.less

+59-46
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ body {
7777
body.home {
7878
#header {
7979
height: 235px;
80-
80+
8181
h1 {
8282
font-size: 60px;
8383
font-weight: normal;
@@ -217,10 +217,8 @@ body.home {
217217

218218
}
219219

220-
h2 {
221-
font-weight: 700;
222-
margin: 35px 0;
223-
}
220+
h2 { font-weight: 700; margin: 35px 0; }
221+
.p-news h2 { font-weight: 600; }
224222

225223
.content {
226224
margin: 0 0 50px;
@@ -358,58 +356,73 @@ h2 {
358356
}
359357
}
360358
}
359+
}
360+
361+
.posts {
362+
line-height: 23px;
361363

362-
.posts {
363-
line-height: 23px;
364-
365-
.post { margin-bottom: 70px; }
366-
367-
h1 {
368-
font-size: 36px; font-weight: 500; margin: 0;
369-
a {
370-
color: #000;
371-
}
372-
}
373-
h2 { font-size: 22px; font-weight: 600; margin: 20px 0 7px; }
374-
h3 { font-size: 17px; font-weight: 600; margin: 0; }
375-
header {
376-
margin: 0 0 15px;
377-
}
378-
.date {
379-
color: @content-light;
380-
margin: 0 0 5px;
364+
.post { margin: 35px 0 70px; }
365+
366+
h1 {
367+
font-size: 36px; font-weight: 500; margin: 0;
368+
a {
369+
color: #000;
381370
}
382-
p {
383-
margin: 0 0 15px;
371+
}
372+
h2 { font-size: 22px; font-weight: 600; margin: 20px 0 7px; }
373+
h3 { font-size: 17px; font-weight: 600; margin: 0; }
374+
header {
375+
margin: 0 0 15px;
376+
}
377+
.date {
378+
color: @content-light;
379+
margin: 0 0 5px;
380+
}
381+
p {
382+
margin: 0 0 15px;
383+
}
384+
.release {
385+
h1 {
386+
display: inline-block;
387+
font-size: 17px;
388+
margin-left: 5px;
384389
}
385-
.release {
386-
h1 {
387-
display: inline-block;
388-
font-size: 17px;
389-
margin-left: 5px;
390-
}
391-
.date { display: inline; }
390+
.date { display: inline; }
391+
}
392+
.tags {
393+
font-size: 0.85em;
394+
a {
395+
display: inline-block;
396+
margin-left: 3px;
392397
}
393-
.tags {
394-
font-size: 0.85em;
395-
a {
396-
display: inline-block;
397-
margin-left: 3px;
398-
}
399-
.glyphicon {
400-
color: #bbb;
401-
font-size: 13px;
402-
position: relative;
403-
top: 3px;
404-
}
398+
.glyphicon {
399+
color: #bbb;
400+
font-size: 13px;
401+
position: relative;
402+
top: 3px;
405403
}
406-
code { font-size: 14px; }
404+
}
405+
code { font-size: 14px; }
406+
}
407+
408+
.postlist {
409+
.Delistify;
410+
411+
li {
412+
.Delistify;
413+
margin-bottom: 10px;
414+
display: block;
415+
}
416+
.date {
417+
color: @content-light;
418+
white-space: nowrap;
407419
}
408420
}
409421

410422
.push {
411423
height: 60px;
412424
}
425+
413426
#footer {
414427
.MainBG;
415428

_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ paginate: 10
1919
permalink: /news/:year/:month/:title
2020
paginate_path: /news/page:num
2121
tag_dir: /news/tags
22+
monthly_archive:
23+
path: /news

_includes/post-item.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<li>
2+
<a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
3+
<span class="date">{{ post.date | date: "%B %-d, %Y" }}</span>
4+
</li>

_includes/post.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<div class="post{% if post.class %}{{ post.class | prepend: " " }}{% endif %}">
22

3-
<header class="post-header">
3+
<header>
44
<p class="date">{{ post.date | date: "%B %-d, %Y" }}</p>
55
<h1><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h1>
66
</header>
77

8-
<article class="post-content">
8+
<article>
99
{{ content }}
1010
</article>
1111

1212
<p class="meta">
1313
<span class="tags">
1414
<span class="glyphicon glyphicon-tag"></span>
1515
{% for tag in post.tags %}
16-
<a href="{{ site.baseurl }}/blog/tags/{{ tag }}">{{ tag }}</a>
16+
<a href="{{ site.baseurl }}/news/tags/{{ tag }}">{{ tag }}</a>
1717
{% endfor %}
1818
</span>
1919
</p>

_layouts/default.html

+4-32
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
1-
<!DOCTYPE html>
2-
<html>
3-
{% include head.html %}
4-
<body class="{{ page.dir | replace: '/', ' p-' | replace_first: ' ', '' }}">
5-
<div id="wrapper">
1+
---
2+
layout: wrapper
63

7-
{% include header.html %}
8-
9-
<div class="container">
10-
<div class="row">
11-
<div class="col-sm-4 col-md-3" id="sidebar">
12-
13-
<div class="form-group input-group has-feedback">
14-
<input type="hidden" class="form-control select2">
15-
<span class="glyphicon glyphicon-search form-control-feedback"></span>
16-
</div>
17-
18-
{% include sidebar.html %}
19-
</div>
20-
21-
<div class="col-sm-8 col-md-9" id="content">
4+
---
225
<header>
236
<h2>{{ page.title }}</h2>
247
</header>
25-
8+
269
<article class="content">
2710
{{ content }}
2811
</article>
29-
30-
</div><!-- content -->
31-
</div><!-- row -->
32-
</div><!-- cont -->
33-
<div class="push"></div>
34-
</div><!-- wrapper -->
35-
36-
{% include footer.html %}
37-
38-
</body>
39-
</html>

_layouts/monthly_archive.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: wrapper
3+
---
4+
5+
<header>
6+
<h2>Posts in <strong>{{ page.date | date: "%B %Y" }}</strong></h2>
7+
</header>
8+
9+
<article class="content">
10+
<ul class="postlist">
11+
{% for post in page.posts %}
12+
13+
{% include post-item.html %}
14+
15+
{% endfor %}
16+
</ul>
17+
18+
<br />
19+
<ul class="pager">
20+
{% if page.previousArchive %}
21+
<li class="previous"><a href="{{ site.baseurl }}/news/{{ page.previousArchive }}">&larr; Older</a></li>
22+
{% endif %}
23+
{% if page.nextArchive %}
24+
<li class="next"><a href="{{ site.baseurl }}/news/{{ page.nextArchive }}">Newer &rarr;</a></li>
25+
{% endif %}
26+
</ul>
27+
</article>
28+

_layouts/post.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: wrapper
3+
---
4+
5+
<div class="posts content">
6+
{% assign post = page %}
7+
{% include post.html %}
8+
9+
<br />
10+
<ul class="pager">
11+
{% if post.previous %}
12+
<li class="previous"><a href="{{ post.previous.url | prepend: site.baseurl }}">&larr; Older</a></li>
13+
{% endif %}
14+
{% if post.next %}
15+
<li class="next"><a href="{{ post.next.url | prepend: site.baseurl }}">Newer &rarr;</a></li>
16+
{% endif %}
17+
</ul>
18+
</div><!-- posts -->
19+

_layouts/tag_index.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: wrapper
3+
---
4+
5+
<header>
6+
<h2>{{ page.title }}</strong></h2>
7+
</header>
8+
9+
<article class="content">
10+
<ul class="postlist">
11+
{% for post in page.posts %}
12+
13+
{% include post-item.html %}
14+
15+
{% endfor %}
16+
</ul>
17+
</article>
18+

_layouts/wrapper.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
{% include head.html %}
4+
<body class="{{ page.dir | replace: '/', ' p-' | replace_first: ' ', '' }}">
5+
<div id="wrapper">
6+
7+
{% include header.html %}
8+
9+
<div class="container">
10+
<div class="row">
11+
<div class="col-sm-4 col-md-3" id="sidebar">
12+
13+
<div class="form-group input-group has-feedback">
14+
<input type="hidden" class="form-control select2">
15+
<span class="glyphicon glyphicon-search form-control-feedback"></span>
16+
</div>
17+
18+
{% include sidebar.html %}
19+
</div>
20+
21+
<div class="col-sm-8 col-md-9" id="content">
22+
{{ content }}
23+
24+
</div><!-- content -->
25+
</div><!-- row -->
26+
</div><!-- cont -->
27+
<div class="push"></div>
28+
</div><!-- wrapper -->
29+
30+
{% include footer.html %}
31+
32+
</body>
33+
</html>

_layouts/yearly_archive.html

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: wrapper
3+
---
4+
5+
<header>
6+
<h2>Posts in <strong>{{ page.date | date: "%Y" }}</strong></h2>
7+
</header>
8+
9+
<article class="content">
10+
<ul class="postlist">
11+
{% assign month = "" %}
12+
{% for post in page.posts %}
13+
14+
{% assign post_month = post.date || date: "%B" %}
15+
{% if post_month != month %}
16+
17+
{% assign month = post_month %}
18+
<h2>{{ post_month }}</h2>
19+
20+
{% endif %}
21+
22+
{% include post-item.html %}
23+
24+
{% endfor %}
25+
</ul>
26+
27+
<br />
28+
<ul class="pager">
29+
{% if page.previousArchive %}
30+
<li class="previous"><a href="{{ site.baseurl }}/news/{{ page.previousArchive }}">&larr; Older</a></li>
31+
{% endif %}
32+
{% if page.nextArchive %}
33+
<li class="next"><a href="{{ site.baseurl }}/news/{{ page.nextArchive }}">Newer &rarr;</a></li>
34+
{% endif %}
35+
</ul>
36+
</article>

0 commit comments

Comments
 (0)