Skip to content

Commit 54418c0

Browse files
committed
Use layout for site homepages
1 parent 97e1575 commit 54418c0

15 files changed

+75
-644
lines changed

_layouts/homepage.html

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: page
3+
4+
javascript:
5+
- examples
6+
7+
sidebar: |
8+
<a href="downloads/">
9+
<img src="/images/download.gif" alt="Download Ruby" title="" />
10+
</a>
11+
12+
---
13+
14+
{% if site.locales.news[page.lang] %}
15+
{% assign news = site.locales.news[page.lang] %}
16+
{% else %}
17+
{% assign news = site.locales.news['en'] %}
18+
{% endif %}
19+
20+
{% for post in site.categories[page.lang] limit:2 %}
21+
<div class="post">
22+
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
23+
24+
{{ post.content | strip_html | truncatewords: 25 }}
25+
26+
<p><a href="{{ post.url }}">{{ news.continue }}</a></p>
27+
28+
<p class="post-info">{{ post.date | posted_by:post.author }}</p>
29+
</div>
30+
{% endfor %}
31+
32+
{% if page.lang == 'pt' %}
33+
{% assign news_dir='noticias-recentes' %}
34+
{% else %}
35+
{% assign news_dir='news' %}
36+
{% endif %}
37+
38+
<div id="news">
39+
<h3><a href="{{ news_dir }}/">{{ news.other_news }}</a></h3>
40+
<ul>
41+
{% for post in site.categories[page.lang] offset:2 limit:3 %}
42+
<li>
43+
<a href="{{ post.url }}">{{ post.title }}</a>
44+
<span class="post-info">{{ post.date | posted_by:post.author }}</span>
45+
</li>
46+
{% endfor %}
47+
</ul>
48+
49+
<ul>
50+
{% for post in site.categories[page.lang] offset:5 limit:3 %}
51+
<li>
52+
<a href="{{ post.url }}">{{ post.title }}</a>
53+
<span class="post-info">{{ post.date | posted_by:post.author }}</span>
54+
</li>
55+
{% endfor %}
56+
</ul>
57+
58+
<p class="more">
59+
<a href="{{ news_dir }}/">{{ news.more_news }}</a>
60+
</p>
61+
</div>

bg/index.html

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
layout: page
2+
layout: homepage
33
title: "Език за програмиране Ruby"
44
lang: bg
55

6-
javascript:
7-
- examples
8-
96
header: |
107
<div id="intro">
118
<h1>Ruby e...</h1>
@@ -20,46 +17,4 @@ <h1>Ruby e...</h1>
2017
</div>
2118
<div id="code"></div>
2219

23-
sidebar: |
24-
<a href="downloads/">
25-
<img src="/images/download.gif" alt="Download Ruby" title="" />
26-
</a>
27-
2820
---
29-
30-
{% for post in site.categories.bg limit:2 %}
31-
<div class="post">
32-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
33-
34-
{{ post.content | strip_html | truncatewords: 25 }}
35-
36-
<p><a href="{{ post.url }}">Прочетете още...</a></p>
37-
38-
<p class="post-info">Публикувана от {{ post.author }} на {{ post.date | date_to_string }}</p>
39-
</div>
40-
{% endfor %}
41-
42-
<div id="news">
43-
<h3><a href="news/">Други новини</a></h3>
44-
<ul>
45-
{% for post in site.categories.bg offset:2 limit:3 %}
46-
<li>
47-
<a href="{{ post.url }}">{{ post.title }}</a>
48-
<span class="post-info">Публикувана от {{ post.author }} на {{ post.date | date_to_string }}</span>
49-
</li>
50-
{% endfor %}
51-
</ul>
52-
53-
<ul>
54-
{% for post in site.categories.bg offset:5 limit:3 %}
55-
<li>
56-
<a href="{{ post.url }}">{{ post.title }}</a>
57-
<span class="post-info">Публикувана от {{ post.author }} на {{ post.date | date_to_string }}</span>
58-
</li>
59-
{% endfor %}
60-
</ul>
61-
62-
<p class="more">
63-
<a href="/bg/news/">Още новини…</a>
64-
</p>
65-
</div>

de/index.html

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
layout: page
2+
layout: homepage
33
title: "Die Programmiersprache Ruby"
44
lang: de
55

6-
javascript:
7-
- examples
8-
96
header: |
107
<div id="intro">
118
<h1>Ruby ist...</h1>
@@ -20,46 +17,4 @@ <h1>Ruby ist...</h1>
2017
</div>
2118
<div id="code"></div>
2219

23-
sidebar: |
24-
<a href="downloads/">
25-
<img src="/images/download.gif" alt="Download Ruby" title="" />
26-
</a>
27-
2820
---
29-
30-
{% for post in site.categories.de limit:2 %}
31-
<div class="post">
32-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
33-
34-
{{ post.content | strip_html | truncatewords: 25 }}
35-
36-
<p><a href="{{ post.url }}">Weiterlesen...</a></p>
37-
38-
<p class="post-info">Geschrieben von {{ post.author }} am {{ post.date | date_to_string }}</p>
39-
</div>
40-
{% endfor %}
41-
42-
<div id="news">
43-
<h3><a href="news/">Weitere Neuigkeiten</a></h3>
44-
<ul>
45-
{% for post in site.categories.de offset:2 limit:3 %}
46-
<li>
47-
<a href="{{ post.url }}">{{ post.title }}</a>
48-
<span class="post-info">Geschrieben von {{ post.author }} am {{ post.date | date_to_string }}</span>
49-
</li>
50-
{% endfor %}
51-
</ul>
52-
53-
<ul>
54-
{% for post in site.categories.de offset:5 limit:3 %}
55-
<li>
56-
<a href="{{ post.url }}">{{ post.title }}</a>
57-
<span class="post-info">Geschrieben von {{ post.author }} am {{ post.date | date_to_string }}</span>
58-
</li>
59-
{% endfor %}
60-
</ul>
61-
62-
<p class="more">
63-
<a href="/de/news/">Ältere Neuigkeiten…</a>
64-
</p>
65-
</div>

en/index.html

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
layout: page
2+
layout: homepage
33
title: Ruby Programming Language
44
lang: en
55

6-
javascript:
7-
- examples
8-
96
header: |
107
<div id="intro">
118
<h1>Ruby is...</h1>
@@ -20,46 +17,4 @@ <h1>Ruby is...</h1>
2017
</div>
2118
<div id="code"></div>
2219

23-
sidebar: |
24-
<a href="downloads/">
25-
<img src="/images/download.gif" alt="Download Ruby" title="" />
26-
</a>
27-
2820
---
29-
30-
{% for post in site.categories.en limit:2 %}
31-
<div class="post">
32-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
33-
34-
{{ post.content | strip_html | truncatewords: 25 }}
35-
36-
<p><a href="{{ post.url }}">Continue Reading...</a></p>
37-
38-
<p class="post-info">Posted By {{ post.author }} on {{ post.date | date_to_string }}</p>
39-
</div>
40-
{% endfor %}
41-
42-
<div id="news">
43-
<h3><a href="news/">Other News</a></h3>
44-
<ul>
45-
{% for post in site.categories.en offset:2 limit:3 %}
46-
<li>
47-
<a href="{{ post.url }}">{{ post.title }}</a>
48-
<span class="post-info">Posted By {{ post.author }} on {{ post.date | date_to_string }}</span>
49-
</li>
50-
{% endfor %}
51-
</ul>
52-
53-
<ul>
54-
{% for post in site.categories.en offset:5 limit:3 %}
55-
<li>
56-
<a href="{{ post.url }}">{{ post.title }}</a>
57-
<span class="post-info">Posted By {{ post.author }} on {{ post.date | date_to_string }}</span>
58-
</li>
59-
{% endfor %}
60-
</ul>
61-
62-
<p class="more">
63-
<a href="/en/news/">More News…</a>
64-
</p>
65-
</div>

es/index.html

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
layout: page
2+
layout: homepage
33
title: "Lenguaje de Programación Ruby"
44
lang: es
55

6-
javascript:
7-
- examples
8-
96
header: |
107
<div id="intro">
118
<h1>Ruby es...</h1>
@@ -20,46 +17,4 @@ <h1>Ruby es...</h1>
2017
</div>
2118
<div id="code"></div>
2219

23-
sidebar: |
24-
<a href="downloads/">
25-
<img src="/images/download.gif" alt="Download Ruby" title="" />
26-
</a>
27-
2820
---
29-
30-
{% for post in site.categories.es limit:2 %}
31-
<div class="post">
32-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
33-
34-
{{ post.content | strip_html | truncatewords: 25 }}
35-
36-
<p><a href="{{ post.url }}">Continuar leyendo...</a></p>
37-
38-
<p class="post-info">Publicado por {{ post.author }} el {{ post.date | date_to_string }}</p>
39-
</div>
40-
{% endfor %}
41-
42-
<div id="news">
43-
<h3><a href="news/">Otras noticias</a></h3>
44-
<ul>
45-
{% for post in site.categories.es offset:2 limit:3 %}
46-
<li>
47-
<a href="{{ post.url }}">{{ post.title }}</a>
48-
<span class="post-info">Publicado por {{ post.author }} el {{ post.date | date_to_string }}</span>
49-
</li>
50-
{% endfor %}
51-
</ul>
52-
53-
<ul>
54-
{% for post in site.categories.es offset:5 limit:3 %}
55-
<li>
56-
<a href="{{ post.url }}">{{ post.title }}</a>
57-
<span class="post-info">Publicado por {{ post.author }} el {{ post.date | date_to_string }}</span>
58-
</li>
59-
{% endfor %}
60-
</ul>
61-
62-
<p class="more">
63-
<a href="/es/news/">Más noticias…</a>
64-
</p>
65-
</div>

fr/index.html

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
layout: page
2+
layout: homepage
33
title: "Le langage Ruby"
44
lang: fr
55

6-
javascript:
7-
- examples
8-
96
header: |
107
<div id="intro">
118
<h1>Ruby...</h1>
@@ -20,46 +17,4 @@ <h1>Ruby...</h1>
2017
</div>
2118
<div id="code"></div>
2219

23-
sidebar: |
24-
<a href="downloads/">
25-
<img src="/images/download.gif" alt="Download Ruby" title="" />
26-
</a>
27-
2820
---
29-
30-
{% for post in site.categories.fr limit:2 %}
31-
<div class="post">
32-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
33-
34-
{{ post.content | strip_html | truncatewords: 25 }}
35-
36-
<p><a href="{{ post.url }}">Lire la suite...</a></p>
37-
38-
<p class="post-info">Posté par {{ post.author }} le {{ post.date | date_to_string }}</p>
39-
</div>
40-
{% endfor %}
41-
42-
<div id="news">
43-
<h3><a href="news/">Autres actualités</a></h3>
44-
<ul>
45-
{% for post in site.categories.fr offset:2 limit:3 %}
46-
<li>
47-
<a href="{{ post.url }}">{{ post.title }}</a>
48-
<span class="post-info">Posté par {{ post.author }} le {{ post.date | date_to_string }}</span>
49-
</li>
50-
{% endfor %}
51-
</ul>
52-
53-
<ul>
54-
{% for post in site.categories.fr offset:5 limit:3 %}
55-
<li>
56-
<a href="{{ post.url }}">{{ post.title }}</a>
57-
<span class="post-info">Posté par {{ post.author }} le {{ post.date | date_to_string }}</span>
58-
</li>
59-
{% endfor %}
60-
</ul>
61-
62-
<p class="more">
63-
<a href="/fr/news/">Plus d’actualités…</a>
64-
</p>
65-
</div>

0 commit comments

Comments
 (0)