Skip to content

Commit df81738

Browse files
committed
Add news feed.
1 parent 7ca2eb3 commit df81738

File tree

5 files changed

+64
-8
lines changed

5 files changed

+64
-8
lines changed

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ t:
7979
en:
8080
description: "IO bus for model railroad accessories control"
8181
keywords: io,bus,mtb,module,uni,ttl,protocol
82+
str_recent_posts: News
83+
str_all_posts: All news
8284
cz:
8385
description: "IO sběrnice pro řízení příslušenství modelových kolejišť"
8486
keywords: io,sběrnice,mtb,modul,uni,ttl,protokol
87+
str_recent_posts: Aktuality
88+
str_all_posts: Všechny aktuality
8589

8690
last-modified-at:
8791
date-format: '%%y-%b-%d'

_layouts/default.html

+18-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
{% capture title %}{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}{% endcapture %}
55

66
{% include page-url-resolver.html page=page %}
7-
8-
{% if page.excerpt %}
9-
{% assign description = page.excerpt | strip_html | strip_newlines | truncate: 160 %}
10-
{% else %}
117
{% assign description = site.t[page.lang]["description"] %}
12-
{% endif %}
138

149
<meta charset="utf-8">
1510
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -87,7 +82,24 @@ <h1 class="clearfix">
8782
<ul class="icons">
8883
{% include icons.html icons=site.icons %}
8984
</ul>
90-
<hr class="with-no-margin"/>
85+
<hr class="with-no-margin margin-bottom"/>
86+
87+
<div class="block sticky">
88+
<h2>{{ site.t[page.lang]['str_recent_posts'] }}</h2>
89+
<ul>
90+
{% assign posts = '' | split: '' %}
91+
{% for post in site.posts %}
92+
{% if post.hide != true %}
93+
{% assign posts = posts | push: post %}
94+
{% endif %}
95+
{% endfor %}
96+
{% assign posts = posts | sort: 'date' | reverse %}
97+
{% for post in posts limit:site.recent_posts_num %}
98+
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.date | date: "%Y-%m-%d" }} {{ post.title }}</a></li>
99+
{% endfor %}
100+
</ul>
101+
<a href="{{ '/archive' | prepend: site.baseurl }}">{{ site.t[page.lang]['str_all_posts'] }}</a>
102+
</div>
91103
</div>
92104
</aside>
93105
</div>

_pages/archive.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: page
3+
title: Všechny aktuality
4+
permalink: /archive/
5+
hide: true
6+
share: false
7+
lang: cz
8+
---
9+
10+
{% for post in site.posts %}
11+
{% unless post.next %}
12+
<h3>{{ post.date | date: '%Y' }}</h3>
13+
<ul>
14+
{% else %}
15+
{% assign year = post.date | date: '%Y' %}
16+
{% assign next_year = post.next.date | date: '%Y' %}
17+
{% if year != next_year %}
18+
</ul>
19+
<h3>{{ post.date | date: '%Y' }}</h3>
20+
<ul>
21+
{% endif %}
22+
{% endunless %}
23+
24+
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.date | date: "%Y-%m-%d" }} {{ post.title }}</a></li>
25+
{% endfor %}
26+
27+
{% if site.posts %}
28+
</ul>
29+
{% endif %}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: post
3+
title: MTB Config Tool v0.2
4+
tags: upgrade
5+
lang: cz
6+
---
7+
8+
Byla vydána nová verze aplikace *MTB Config Tool*, která přináší oproti verzi
9+
0.1 možnost zobrazit stav vstupů MTB modulů a nastavit výstupy modulů.
10+
11+
<a class="btn" href="https://github.com/kmzbrnoI/mtb-config-tool/releases/tag/v0.2">MTB Config Tool v0.2</a>

_sass/_aside.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
border-top: 3px solid $brand-color;
88
}
99

10-
h2 {
10+
h1 {
1111
font-size: 1.2em;
1212
line-height: 1.3;
1313
margin: 1em 0;
1414
}
1515

1616
.block {
1717
margin-bottom: $margin;
18-
h2 {
18+
h1 {
1919
margin: 0;
2020
}
2121
}

0 commit comments

Comments
 (0)