Skip to content

Commit cd8dccb

Browse files
committed
Update
1 parent 4000a1e commit cd8dccb

2 files changed

Lines changed: 68 additions & 38 deletions

File tree

_layouts/frontpage.html

Lines changed: 61 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,74 +10,97 @@
1010
</div><!-- /#header-home -->
1111

1212

13+
{% comment %}
14+
*
15+
* First check, if widget is empty or not by checking if there is a title
16+
*
17+
{% endcomment %}
1318
<div class="row t60">
19+
{% if page.widget-1.title %}
1420
<div class="medium-4 columns">
1521
<a href="{{ page.widget-1.url }}">{% if page.widget-1.image %}<img src="{{ site.urlimg }}/{{ page.widget-1.image }}" width="302" height="182" alt="">{% endif %}{% if page.widget-1.video %}{{ page.widget-1.video }}{% endif %}</a>
1622
<h2 class="font-size-h3 t10">{{ page.widget-1.title }}</h2>
1723
<p>{{ page.widget-1.text }}</p>
1824
<p><a class="button tiny radius" href="{{ page.widget-1.url }}">{{ site.data.language.more }}</a></p>
1925
</div><!-- /.medium-4.columns -->
26+
{% endif %}
2027

2128

29+
{% if page.widget-2.title %}
2230
<div class="medium-4 columns">
2331
<a href="{{ page.widget-2.url }}">{% if page.widget-2.image %}<img src="{{ site.urlimg }}/{{ page.widget-2.image }}" width="302" height="182" alt="">{% endif %}{% if page.widget-2.video %}{{ page.widget-2.video }}{% endif %}</a>
2432
<h2 class="font-size-h3 t10">{{ page.widget-2.title }}</h2>
2533
<p>{{ page.widget-2.text }}</p>
2634
<p><a class="button tiny radius" href="{{ page.widget-2.url }}">{{ site.data.language.more }}</a></p>
2735
</div><!-- /.medium-4.columns -->
36+
{% endif %}
2837

2938

39+
{% if page.widget-3.title %}
3040
<div class="medium-4 columns">
31-
<a href="{{ page.widget-3.url }}">{% if page.widget-3.image %}<img src="{{ site.urlimg }}/{{ page.widget-3.image }}" width="302" height="182" alt="">{% endif %}{% if page.widget-3.video %}{{ page.widget-3.video }}{% endif %}</a>
41+
<a href="{{ page.widget-3.url }}">{% if page.widget-3.image %}<img src="{{ site.urlimg }}/{{ page.widget-3.image }}" width="302" height="182" alt="">{% endif %}{% if page.widget-3.video %}{{ page.widget-3.video }}{% endif %}</a>
3242
<h2 class="font-size-h3 t10">{{ page.widget-3.title }}</h2>
3343
<p>{{ page.widget-3.text }}</p>
3444
<p><a class="button tiny radius" href="{{ page.widget-3.url }}">Download &#64; GitHub ›</a></p>
3545
</div><!-- /.medium-4.columns -->
46+
{% endif %}
3647
</div><!-- /.row -->
3748

3849

50+
{% comment %}
51+
*
52+
* First check, if there are any posts at all
53+
*
54+
{% endcomment %}
3955

40-
<div class="row t30 b20 homepage">
41-
<div class="small-12 columns">
42-
{% for post in site.posts limit:1 %}
43-
{% if post.image.homepage %}
44-
<p>
45-
<a href="{{ site.url }}{{ post.url }}" title="{{ post.title escape_once }}"><img width="970" src="{{ site.url }}/images/{{ post.image.homepage }}" alt="{{ page.title escape_once }}"></a>
46-
</p>
47-
48-
{% if post.image.url && post.image.credit %}
49-
<p class="text-right caption">
50-
<a href="{{ post.image.url }}">{{ post.image.credit }}</a>
51-
</p>
52-
{% endif %}
53-
{% elsif post.image.homepage == NULL %}
54-
<h2>{{ site.data.language.new_blog_entries }}</h2>
55-
{% endif %}
56-
{% endfor %}
57-
</div><!-- /.small-12.columns -->
58-
</div><!-- /.row -->
56+
{% unless site.posts == empty %}
57+
<div class="row t30 b20 homepage">
58+
<div class="small-12 columns">
59+
{% for post in site.posts limit:1 %}
60+
{% if post.image.homepage %}
61+
<p>
62+
<a href="{{ site.url }}{{ post.url }}" title="{{ post.title escape_once }}"><img width="970" src="{{ site.url }}/images/{{ post.image.homepage }}" alt="{{ page.title escape_once }}"></a>
63+
</p>
64+
65+
{% if post.image.url && post.image.credit %}
66+
<p class="text-right caption">
67+
<a href="{{ post.image.url }}">{{ post.image.credit }}</a>
68+
</p>
69+
{% endif %}
70+
{% elsif post.image.homepage == NULL %}
71+
<h2>{{ site.data.language.new_blog_entries }}</h2>
72+
{% endif %}
73+
{% endfor %}
74+
</div><!-- /.small-12.columns -->
75+
</div><!-- /.row -->
5976

6077

78+
<div class="row">
79+
<div class="medium-6 columns">
80+
{% for post in site.posts limit:1 %}
81+
{% if post.subheadline %}<p class="subheadline">{{ post.subheadline }}</p>{% endif %}
82+
<h2><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></h2>
83+
<p>
84+
{% if post.meta_description %}{{ post.meta_description | strip_html | escape }}{% elsif post.teaser %}{{ post.teaser | strip_html | escape }}{% endif %}
85+
<a href="{{ site.url }}{{ post.url }}" title="Read {{ post.title escape_once }}"><strong>{{ site.data.language.read_more }}</strong></a>
86+
</p>
87+
{% endfor %}
88+
</div><!-- /.medium-5.columns -->
89+
90+
91+
<div class="medium-6 columns">
92+
<p><strong>{{ site.data.language.more_articles }}</strong></p>
93+
{% include list-posts.html entries='3' offset='1' %}
94+
</div><!-- /.medium-7.columns -->
95+
</div><!-- /.row -->
96+
{% endunless %}
6197

62-
<div class="row">
63-
<div class="medium-6 columns">
64-
{% for post in site.posts limit:1 %}
65-
<p class="subheadline">{% if post.subheadline %}{{ post.subheadline }}{% endif %}</p>
66-
<h2><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></h2>
67-
<p>
68-
{% if post.meta_description %}{{ post.meta_description | strip_html | escape }}{% elsif post.teaser %}{{ post.teaser | strip_html | escape }}{% endif %}
69-
<a href="{{ site.url }}{{ post.url }}" title="Read {{ post.title escape_once }}"><strong>{{ site.data.language.read_more }}</strong></a>
70-
</p>
71-
{% endfor %}
72-
</div><!-- /.medium-5.columns -->
73-
74-
75-
<div class="medium-6 columns">
76-
<p><strong>{{ site.data.language.more_articles }}</strong></p>
77-
{% include list-posts.html entries='3' offset='1' %}
78-
</div><!-- /.medium-7.columns -->
79-
</div><!-- /.row -->
8098

99+
{% comment %}
100+
*
101+
* Finally, if there is content, spit it out.
102+
*
103+
{% endcomment %}
81104

82105
<div class="row">
83106
{{ content }}

_posts/design/2015-02-10-header-with-text.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ header:
1717
---
1818

1919

20+
## Front Matter Code
21+
22+
~~~
23+
header:
24+
title: header with text
25+
image_fullwidth: unsplash_brooklyn-bridge_header.jpg
26+
~~~
2027

2128
### All Header-Styles
2229
{: .t60 }

0 commit comments

Comments
 (0)