Skip to content

Commit 0ea4231

Browse files
committed
Refactor default layout
1 parent 15a4354 commit 0ea4231

File tree

5 files changed

+91
-105
lines changed

5 files changed

+91
-105
lines changed

_layouts/default.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% include top.html %}
2+
3+
<div id="content">
4+
{{ content }}
5+
</div><!-- #content -->
6+
7+
{% include sidebar.html %}
8+
{% include bottom.html %}

_layouts/post.html

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,52 @@
11
---
22
section: blog
3+
layout: default
34
---
45

5-
{% include top.html %}
6+
<div class="hfeed">
7+
<div class="hentry post">
8+
<div class="post-content">
9+
<div class="sticky-header">
10+
<h1>{{ page.title }}</h1>
11+
<div class="byline">{{ page.date | date: "%B %d, %Y" }}{% if page.author %} · by {{ page.author}}{% endif %} . in {% for category in page.categories %}<span class="category"><a href="/blog/categories.html#{{category}}">{{ category | capitalize }}</a>{% endfor %}</div>
12+
</div><!-- .sticky-header -->
613

7-
<div id="content">
8-
<div class="hfeed">
9-
<div class="hentry post">
10-
<div class="post-content">
11-
<div class="sticky-header">
12-
<h1>{{ page.title }}</h1>
13-
<div class="byline">{{ page.date | date: "%B %d, %Y" }}{% if page.author %} · by {{ page.author}}{% endif %} . in {% for category in page.categories %}<span class="category"><a href="/blog/categories.html#{{category}}">{{ category | capitalize }}</a>{% endfor %}</div>
14-
</div><!-- .sticky-header -->
15-
16-
<div class="entry-content">
17-
{{ content }}
18-
</div>
14+
<div class="entry-content">
15+
{{ content }}
16+
</div>
1917

20-
<div class="entry-meta">
21-
<div class="share-buttons">
22-
<span class="twitter">
23-
<a href="https://twitter.com/share" class="twitter-share-button" data-via="elixirlang">Tweet</a>
24-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
25-
</span>
18+
<div class="entry-meta">
19+
<div class="share-buttons">
20+
<span class="twitter">
21+
<a href="https://twitter.com/share" class="twitter-share-button" data-via="elixirlang">Tweet</a>
22+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
23+
</span>
2624

27-
<span class="facebook">
28-
<div id="fb-root"></div>
29-
<script>(function(d, s, id) {
30-
var js, fjs = d.getElementsByTagName(s)[0];
31-
if (d.getElementById(id)) return;
32-
js = d.createElement(s); js.id = id;
33-
js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
34-
fjs.parentNode.insertBefore(js, fjs);
35-
}(document, 'script', 'facebook-jssdk'));</script>
36-
<div class="fb-like" data-send="false" data-layout="button_count" data-width="100" data-show-faces="true"></div>
37-
</span>
25+
<span class="facebook">
26+
<div id="fb-root"></div>
27+
<script>(function(d, s, id) {
28+
var js, fjs = d.getElementsByTagName(s)[0];
29+
if (d.getElementById(id)) return;
30+
js = d.createElement(s); js.id = id;
31+
js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
32+
fjs.parentNode.insertBefore(js, fjs);
33+
}(document, 'script', 'facebook-jssdk'));</script>
34+
<div class="fb-like" data-send="false" data-layout="button_count" data-width="100" data-show-faces="true"></div>
35+
</span>
3836

39-
<span class="google-plus">
40-
<!-- Place this render call where appropriate -->
41-
<script type="text/javascript">
42-
(function() {
43-
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
44-
po.src = 'https://apis.google.com/js/plusone.js';
45-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
46-
})();
47-
</script>
48-
<g:plusone size="medium"></g:plusone>
49-
</span>
50-
</div>
37+
<span class="google-plus">
38+
<!-- Place this render call where appropriate -->
39+
<script type="text/javascript">
40+
(function() {
41+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
42+
po.src = 'https://apis.google.com/js/plusone.js';
43+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
44+
})();
45+
</script>
46+
<g:plusone size="medium"></g:plusone>
47+
</span>
5148
</div>
5249
</div>
5350
</div>
54-
</div><!-- .hfeed -->
55-
</div><!-- #content -->
56-
57-
{% include sidebar.html %}
58-
{% include bottom.html %}
51+
</div>
52+
</div><!-- .hfeed -->

blog/categories.html

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
---
22
title: Posts by category
33
section: blog
4+
layout: default
45
---
56

6-
{% include top.html %}
7-
8-
<div id="content">
9-
<div class="hfeed">
10-
<h2>Posts by category:</h2>
11-
<ul>
12-
{% for category in site.categories %}
13-
<li id="#{{ category | first }}">{{ category | first | capitalize }}</li>
14-
<ul>
15-
{% for posts in category %}
16-
{% for post in posts %}
17-
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
18-
{% endfor %}
7+
<div class="hfeed">
8+
<h2>Posts by category:</h2>
9+
<ul>
10+
{% for category in site.categories %}
11+
<li id="#{{ category | first }}">{{ category | first | capitalize }}</li>
12+
<ul>
13+
{% for posts in category %}
14+
{% for post in posts %}
15+
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
1916
{% endfor %}
20-
</ul>
21-
</li>
22-
{% endfor %}
23-
</ul>
24-
</div><!-- .hfeed -->
25-
</div><!-- #content -->
26-
27-
{% include bottom.html %}
17+
{% endfor %}
18+
</ul>
19+
</li>
20+
{% endfor %}
21+
</ul>
22+
</div><!-- .hfeed -->

blog/index.html

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
---
22
title: Blog
33
section: blog
4+
layout: default
45
---
56

6-
{% include top.html %}
7+
<div class="hfeed">
8+
{% for post in site.posts %}
9+
<div class="hentry post">
10+
<div class="sticky-header">
11+
<h2 class="entry-title"><a href="{{ post.url }}" title="{{ post.title }}" rel="bookmark">{{ post.title }}</a></h2>
12+
<div class="byline">{{ post.date | date: "%B %d, %Y" }}{% if post.author %} · by {{ post.author}}{% endif %} . in {% for category in post.categories %}<span class="category"><a href="/blog/categories.html#{{category}}">{{ category | capitalize }}</a>{% endfor %}</div>
13+
</div><!-- .sticky-header -->
714

8-
<div id="content">
9-
<div class="hfeed">
10-
{% for post in site.posts %}
11-
<div class="hentry post">
12-
<div class="sticky-header">
13-
<h2 class="entry-title"><a href="{{ post.url }}" title="{{ post.title }}" rel="bookmark">{{ post.title }}</a></h2>
14-
<div class="byline">{{ post.date | date: "%B %d, %Y" }}{% if post.author %} · by {{ post.author}}{% endif %} . in {% for category in post.categories %}<span class="category"><a href="/blog/categories.html#{{category}}">{{ category | capitalize }}</a>{% endfor %}</div>
15-
</div><!-- .sticky-header -->
16-
17-
<div class="entry-summary">
18-
{{ post.content | strip_html | truncatewords:80 }}
19-
</div><!-- .entry-summary -->
20-
</div>
21-
{% endfor %}
22-
</div><!-- .hfeed -->
23-
</div><!-- #content -->
24-
25-
{% include sidebar.html %}
26-
{% include bottom.html %}
15+
<div class="entry-summary">
16+
{{ post.content | strip_html | truncatewords:80 }}
17+
</div><!-- .entry-summary -->
18+
</div>
19+
{% endfor %}
20+
</div><!-- .hfeed -->

index.html

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
---
22
section: home
3+
layout: default
34
---
45

5-
{% include top.html %}
6-
<div id="content">
7-
<div class="hfeed">
8-
<div class="hentry post">
9-
<img src="/images/contents/home-code.png" alt="Elixir Sample" class="archive-thumbnail" />
6+
<div class="hfeed">
7+
<div class="hentry post">
8+
<img src="/images/contents/home-code.png" alt="Elixir Sample" class="archive-thumbnail" />
109

11-
<div class="sticky-header">
12-
<h2 class="entry-title">What is Elixir?</h2>
13-
</div>
10+
<div class="sticky-header">
11+
<h2 class="entry-title">What is Elixir?</h2>
12+
</div>
1413

15-
<div class="entry-summary">
16-
<p>Elixir is a programming language built on top of the Erlang VM. As Erlang, it is a functional language built to support distributed, fault-tolerant, non-stop applications with hot code swapping.</p>
17-
<p>Elixir is also dynamic typed but, differently from Erlang, it is also homoiconic, allowing meta-programming via macros. Elixir also supports polymorphism via protocols (similar to Clojure's), dynamic records and provides a reference mechanism.</p>
18-
<p>Finally, Elixir and Erlang share the same bytecode and data types. This means you can invoke Erlang code from Elixir (and vice-versa) without any conversion or performance hit. This allows a developer to mix the expressiveness of Elixir with the robustness and performance of Erlang.</p>
19-
<p>If you want to install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>.</p>
20-
</div>
14+
<div class="entry-summary">
15+
<p>Elixir is a programming language built on top of the Erlang VM. As Erlang, it is a functional language built to support distributed, fault-tolerant, non-stop applications with hot code swapping.</p>
16+
<p>Elixir is also dynamic typed but, differently from Erlang, it is also homoiconic, allowing meta-programming via macros. Elixir also supports polymorphism via protocols (similar to Clojure's), dynamic records and provides a reference mechanism.</p>
17+
<p>Finally, Elixir and Erlang share the same bytecode and data types. This means you can invoke Erlang code from Elixir (and vice-versa) without any conversion or performance hit. This allows a developer to mix the expressiveness of Elixir with the robustness and performance of Erlang.</p>
18+
<p>If you want to install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>.</p>
2119
</div>
2220
</div>
2321
</div>
24-
25-
{% include sidebar.html %}
26-
{% include bottom.html %}

0 commit comments

Comments
 (0)