Skip to content

Commit 5871989

Browse files
committed
Improvements in the new approach to posting posts and articles.
Articles that were previously treated as pages are now treated as post, to differentiate them, the "post" and "articles" layout should be used respectively. The old folder "/ page / articles" now only contains the file that generates an index for listing articles published with the layout of the same name. The files that were there were moved to the folder "_post / articles" which are now adjusted for use in this format of posts but with the aforementioned remarks. To prevent articles from being listed in the default paigning and on the / blog / (old / news /) page, they must be marked with the hidden parameter that is observed by the pager to prevent publications that have it as true non-matching. All other posts should be made as default using the "post" layout. The files that were in the folder "_post / articles" were moved to "_post / news" and had the "article" category removed to be used only in posts that fall into this category. The file that generates the index page of the blog is now in / pages / blog to keep the same pattern of page creation. An algorithm has been added that prevents the news frame from being displayed when displaying the post listings on the link / blog /. The parameters in the _config.yml file that change the number of posts (news) listed have been changed so that you can group by layout used. Layout articles were created which is nothing more than a default wrapper. Also added were two icons with flags of the current languages ​​for future use and other small changes.
1 parent 4786310 commit 5871989

19 files changed

+110
-51
lines changed

Gemfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
source "https://rubygems.org"
22

3-
gem 'jekyll'
3+
gem 'jekyll', '=3.2.1', :platforms => [:ruby, :x64_mingw, :mswin]
44
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
55

66
group :jekyll_plugins do
77
gem 'jekyll-watch'
8-
gem 'jekyll-last-modified-at'
9-
# gem 'jekyll-multiple-languages'
10-
gem 'jekyll-mentions'
118
gem 'jemoji'
12-
gem 'jekyll-redirect-from'
13-
gem 'jekyll-sitemap'
149
gem 'jekyll-paginate'
10+
gem 'jekyll-last-modified-at', '>=1.0.0', :platforms => [:ruby, :x64_mingw, :mswin]
11+
gem 'jekyll-mentions', '=1.1.3', :platforms => [:ruby, :x64_mingw, :mswin]
12+
gem 'jekyll-redirect-from', '=0.11.0', :platforms => [:ruby, :x64_mingw, :mswin]
13+
gem 'jekyll-sitemap', '=0.11.0', :platforms => [:ruby, :x64_mingw, :mswin]
14+
# gem 'jekyll-multiple-languages'
1515
end

Gemfile.lock

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GEM
99
tzinfo (~> 1.1)
1010
addressable (2.4.0)
1111
colorator (1.1.0)
12-
ffi (1.9.14)
12+
ffi (1.9.14-x64-mingw32)
1313
forwardable-extended (2.6.0)
1414
gemoji (2.1.0)
1515
html-pipeline (2.4.2)
@@ -26,8 +26,9 @@ GEM
2626
pathutil (~> 0.9)
2727
rouge (~> 1.7)
2828
safe_yaml (~> 1.0)
29-
jekyll-last-modified-at (0.3.4)
30-
jekyll
29+
jekyll-last-modified-at (1.0.0)
30+
jekyll (~> 3.2.1)
31+
posix-spawn (~> 0.3.9)
3132
jekyll-mentions (1.1.3)
3233
html-pipeline (~> 2.3)
3334
jekyll (~> 3.0)
@@ -53,14 +54,13 @@ GEM
5354
rb-inotify (~> 0.9, >= 0.9.7)
5455
mercenary (0.3.6)
5556
mini_portile2 (2.1.0)
56-
minitest (5.9.0)
57-
nokogiri (1.6.8)
57+
minitest (5.9.1)
58+
nokogiri (1.6.8.1-x64-mingw32)
5859
mini_portile2 (~> 2.1.0)
59-
pkg-config (~> 1.1.7)
6060
pathutil (0.14.0)
6161
forwardable-extended (~> 2.6)
62-
pkg-config (1.1.7)
63-
rb-fsevent (0.9.7)
62+
posix-spawn (0.3.12)
63+
rb-fsevent (0.9.8)
6464
rb-inotify (0.9.7)
6565
ffi (>= 0.5.0)
6666
rouge (1.11.1)
@@ -69,19 +69,21 @@ GEM
6969
thread_safe (0.3.5)
7070
tzinfo (1.2.2)
7171
thread_safe (~> 0.1)
72+
wdm (0.1.1)
7273

7374
PLATFORMS
74-
ruby
75+
x64-mingw32
7576

7677
DEPENDENCIES
77-
jekyll
78-
jekyll-last-modified-at
79-
jekyll-mentions
78+
jekyll (= 3.2.1)
79+
jekyll-last-modified-at (>= 1.0.0)
80+
jekyll-mentions (= 1.1.3)
8081
jekyll-paginate
81-
jekyll-redirect-from
82-
jekyll-sitemap
82+
jekyll-redirect-from (= 0.11.0)
83+
jekyll-sitemap (= 0.11.0)
8384
jekyll-watch
8485
jemoji
86+
wdm (>= 0.1.0)
8587

8688
BUNDLED WITH
87-
1.12.5
89+
1.13.6

_config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ kramdown:
5050
# paginate: 2
5151
# paginate_path: "/blog/page:num/"
5252

53-
# The number of links added to the 'Latest news' box.
54-
latest-news-pages: 4
55-
56-
# The number of links added to the 'Latest articles' box.
57-
latest-articles-pages: 4
58-
53+
# The number of links added to the 'Latest posts' and 'articles' box.
54+
latestpages:
55+
post: 4
56+
article: 4
57+
5958
# Currently disabled, since it generates incomplete content.
6059
# Use manually written RSS feed.xml.
6160
# - jekyll-feed

_data/i18n.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
langs:
2+
- en
3+
- pt
4+
5+
flags:
6+
en: UnitedStates_US_USA_840_Flag2_26075.png
7+
pt: Brazil_BR_BRA_076_Flag2_26091.png
8+
19
contents:
210
en: Contents
311
pt: Conteúdo
12+
13+
news:
14+
en: News
15+
pt: Notícias

_includes/content/latest-news.markdown

Lines changed: 0 additions & 4 deletions
This file was deleted.

_includes/content/latest.markdown

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if include.title %}
2+
{% if include.url %}
3+
#### [ {{ include.title }} ]({{ include.url }})
4+
{% else %}
5+
#### {{ include.title }}
6+
{% endif %}
7+
{% endif %}
8+
9+
<ul>
10+
{% for post in site.posts limit: site.latestpages[include.layout] %}
11+
{% if post.layout == include.layout %} <li><a href="{{ post.url }}">{{ post.title }}</a></li>{% endif %}
12+
{% endfor %}
13+
</ul>

_includes/content/sidebar-pt.markdown

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@
4747
* [Relatar problemas no CMSIS++](https://github.com/micro-os-plus/cmsis-plus/issues/)
4848
* [Relatar problemas no µOS++ IIIe](https://github.com/micro-os-plus/micro-os-plus-iii/issues/)
4949

50-
#### Últimos Artigos
50+
{% comment %}
51+
#### [Últimos Artigos](/articles/)
52+
{% endcomment %}
5153

52-
* [CMSIS++ RTOS: fully functional reference implementation]({{ site.baseurl }}/articles/arm-com-2016-06-24/)
53-
* [CMSIS++: a proposal for a future CMSIS, written in C++]({{ site.baseurl }}/articles/arm-com-2016-03-11/)
54+
{% include content/latest.markdown lang="en" layout="article" title="Últimos Artigos" url="/articles/" %}
5455

5556
#### Licença
5657

_includes/content/sidebar.markdown

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@
4747
* [Report CMSIS++ issues](https://github.com/micro-os-plus/cmsis-plus/issues/)
4848
* [Report µOS++ IIIe issues](https://github.com/micro-os-plus/micro-os-plus-iii/issues/)
4949

50-
#### Latest Articles
50+
{% comment %}
51+
#### [Latest Articles](/articles/)
52+
{% endcomment %}
5153

52-
<ul>
53-
{% for post in site.posts limit:latest-articles-pages %}
54-
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
55-
{% endfor %}
56-
</ul>
54+
{% include content/latest.markdown lang="en" layout="article" title="Latest Articles" url="/articles/" %}
5755

5856
#### License
5957

_includes/layouts/sidebar.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
<div class="site-sidebar">
2-
3-
{% if site.latest-news-pages %}
2+
{% if site.latestpages.post and page.url != "/blog/" and page.url != "/news/" %}
43
<div class="custom-sidebar">
54
<div class="boxed-group-inner">
6-
{% capture ln %}{% include content/latest-news.markdown %}{% endcapture %}{{ ln | markdownify }}
5+
{% assign title=site.data.i18n.news[include.lang] | default: "News" %}
6+
{% capture url %}{{ site.baseurl | append: "/blog/" }}{% endcapture %}
7+
{% capture ln %}
8+
{% include content/latest.markdown
9+
lang=include.lang
10+
layout="post"
11+
url=url
12+
title=title
13+
%}
14+
{% endcapture %}{{ ln | markdownify }}
715
</div>
816
</div>
917
{% endif %}
1018

1119
<div class="custom-sidebar">
1220
<div class="boxed-group-inner">
13-
{% if page.lang != null and page.lang != "en" %}
14-
{% capture sidebar_file %}sidebar-{{ page.lang }}.markdown{% endcapture %}
21+
{% if include.lang != null and include.lang != "en" %}
22+
{% capture sidebar_file %}sidebar-{{ include.lang }}.markdown{% endcapture %}
1523
{% endif %}
16-
{% capture sb %}{% include content/{{ sidebar_file | default: "sidebar.markdown" }} %}{% endcapture %}{{ sb | markdownify }}
24+
{% capture sb %}{% include content/{{ sidebar_file | default: "sidebar.markdown" }} layout=include.layout %}{% endcapture %}{{ sb | markdownify }}
1725
</div>
1826
</div>
1927

_layouts/article.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
layout: page
3+
---
4+
5+
{{ content }}

0 commit comments

Comments
 (0)