File tree 7 files changed +47
-38
lines changed
7 files changed +47
-38
lines changed Original file line number Diff line number Diff line change 12
12
</author >
13
13
<updated >{{feed_updated}}</updated >
14
14
15
- {{#each posts} }
15
+ {% for post in posts % }
16
16
<entry >
17
- <title >{{title}}</title >
18
- <link rel =" alternate" href =" https://blog.rust-lang.org/{{../ blog.prefix}}{{url}}" type =" text/html" title =" {{title}}" />
19
- <published >{{published}}</published >
20
- <updated >{{updated}}</updated >
21
- <id >https://blog.rust-lang.org/{{../ blog.prefix}}{{url}}</id >
22
- <content type =" html" xml : base =" https://blog.rust-lang.org/{{../ blog.prefix}}{{url}}" >{{contents}}</content >
17
+ <title >{{post. title}}</title >
18
+ <link rel =" alternate" href =" https://blog.rust-lang.org/{{blog.prefix}}{{post. url}}" type =" text/html" title =" {{post. title}}" />
19
+ <published >{{post. published}}</published >
20
+ <updated >{{post. updated}}</updated >
21
+ <id >https://blog.rust-lang.org/{{blog.prefix}}{{post. url}}</id >
22
+ <content type =" html" xml : base =" https://blog.rust-lang.org/{{blog.prefix}}{{post. url}}" >{{post. contents}}</content >
23
23
24
24
<author >
25
- <name >{{author}}</name >
25
+ <name >{{post. author}}</name >
26
26
</author >
27
27
</entry >
28
- {{/each} }
28
+ {% endfor % }
29
29
</feed >
Original file line number Diff line number Diff line change
1
+ {% macro footer(root) -%}
1
2
<footer>
2
3
<div class="w-100 mw-none ph3 mw8-m mw9-l center f3">
3
4
<div class="row">
44
45
45
46
<!-- scripts -->
46
47
<script src="{{root}}scripts/highlight.js"></script>
48
+ {% endmacro %}
Original file line number Diff line number Diff line change
1
+ {% macro headers(root, title, blog) -%}
1
2
<!-- Twitter card -->
2
3
<meta name="twitter:card" content="summary">
3
4
<meta name="twitter:site" content="@rustlang">
4
5
<meta name="twitter:creator" content="@rustlang">
5
- <meta name="twitter:title" content="{{title}}">
6
+ <meta name="twitter:title" content="{{title | escape_hbs }}">
6
7
<meta name="twitter:description" content="{{blog.description}}">
7
8
<meta name="twitter:image" content="https://www.rust-lang.org/static/images/rust-social.jpg">
8
9
9
10
<!-- Facebook OpenGraph -->
10
- <meta property="og:title" content="{{title}}" />
11
+ <meta property="og:title" content="{{title | escape_hbs }}" />
11
12
<meta property="og:description" content="{{blog.description}}">
12
13
<meta property="og:image" content="https://www.rust-lang.org/static/images/rust-social-wide.jpg" />
13
14
<meta property="og:type" content="website" />
39
40
40
41
<!-- theme switcher -->
41
42
<script src="{{root}}scripts/theme-switch.js"></script>
43
+ {% endmacro %}
Original file line number Diff line number Diff line change 1
- {{#*inline "page"}}
1
+ {% extends "layout.tera" %}
2
+ {% block page %}
2
3
<header class="mt3 mt0-ns mb4-ns">
3
4
<div class="container flex flex-column flex-row-l justify-between-l">
4
5
<div class="mw6-l">
5
- <p>{{{ blog.index_html} }}</p>
6
+ <p>{{blog.index_html}}</p>
6
7
</div>
7
8
</div>
8
9
<div class="container flex flex-column flex-row-l justify-between-l">
9
10
<div class="mw8-l">
10
11
<p>
11
12
<b>See also:</b>
12
- {{#each other_blogs} }
13
- <a href="{{../ root}}{{url}}">{{link_text}}</a>
14
- {{/each} }
13
+ {%- for other in other_blogs % }
14
+ <a href="{{root}}{{other. url}}">{{other. link_text | escape_hbs }}</a>
15
+ {%- endfor % }
15
16
</p>
16
17
</div>
17
18
</div>
21
22
<div class="w-100 mw-none ph3 mw8-m mw9-l center f3">
22
23
23
24
<table class="post-list collapse w-100 f2-l f2-m f3-s">
24
- {{#each blog.posts} }
25
- {{# if show_year} }<tr>
25
+ {%- for post in blog.posts % }
26
+ {% if post. show_year % }<tr>
26
27
<td class="bn"></td>
27
- <td class="bn"><h3 class="f0-l f1-m f2-s mt4 mb0">Posts in {{year}}</h3></td>
28
- </tr>{{/if} }
28
+ <td class="bn"><h3 class="f0-l f1-m f2-s mt4 mb0">Posts in {{post. year}}</h3></td>
29
+ </tr>{% endif % }
29
30
<tr>
30
- <td class="tr o-60 pr4 pr5-l bn">{{month_name month}} {{day}}</td>
31
- <td class="bn"><a href="{{url}}">{{title}}</a></td>
31
+ <td class="tr o-60 pr4 pr5-l bn">{{post. month | month_name }} {{post. day}}</td>
32
+ <td class="bn"><a href="{{post. url}}">{{post. title | escape_hbs }}</a></td>
32
33
</tr>
33
- {{/each} }
34
+ {%- endfor % }
34
35
</table>
35
36
36
37
</div>
37
38
</section>
38
- {{/inline}}
39
- {{~> layout~}}
39
+ {%- endblock page %}
Original file line number Diff line number Diff line change
1
+ {% import "headers.tera" as headers %}
2
+ {% import "nav.tera" as nav %}
3
+ {% import "footer.tera" as footer %}
1
4
<!DOCTYPE html>
2
5
<html lang="en">
3
6
<head>
4
7
<meta charset="utf-8">
5
- <title>{{ title }}</title>
8
+ <title>{{ title | escape_hbs }}</title>
6
9
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7
10
<meta name="description" content="Empowering everyone to build reliable and efficient software.">
8
- {{> headers }}
11
+ {{ headers::headers(root=root, title=title, blog=blog) | indent(prefix=" ", blank=true) }}
9
12
</head>
10
13
<body>
11
- {{> nav }}
12
- {{~> page} }
13
- {{> footer }}
14
+ {{ nav::nav(root=root, blog=blog) | indent(prefix=" ", blank=true) }}
15
+ {%- block page %}{% endblock page % }
16
+ {{ footer::footer(root=root) | indent(prefix=" ", blank=true) }}
14
17
</body>
15
18
</html>
Original file line number Diff line number Diff line change
1
+ {% macro nav(root, blog) -%}
1
2
<nav class="flex flex-row justify-center justify-end-l items-center flex-wrap ph2 pl3-ns pr4-ns">
2
3
<div class="brand flex-auto w-100 w-auto-l self-start tc tl-l">
3
4
<a href="{{root}}{{blog.prefix}}">
23
24
<script src="{{root}}scripts/theme-switch-post.js"></script>
24
25
</ul>
25
26
</nav>
27
+ {% endmacro %}
Original file line number Diff line number Diff line change 1
- {{#*inline "page"}}
2
- <section id="{{post.title}}" class="white">
1
+ {% extends "layout.tera" %}
2
+ {% block page %}
3
+ <section id="{{post.title | escape_hbs}}" class="white">
3
4
<div class="w-100 mw-none ph3 mw8-m mw8-l center f3">
4
5
<header>
5
- <h2>{{ post.title }}</h2>
6
+ <h2>{{ post.title | escape_hbs }}</h2>
6
7
<div class="highlight mt2 mb3"></div>
7
8
</header>
8
9
9
- <div class="publish-date-author">{{month_name post.month}} {{post.day}}, {{post.year}} · {{post.author}}
10
- {{# if post.has_team}} on behalf of <a href="{{post.team_url}}">{{post.team}}</a> {{/if} }
10
+ <div class="publish-date-author">{{post.month | month_name }} {{post.day}}, {{post.year}} · {{post.author | escape_hbs }}
11
+ {% if post.has_team %} on behalf of <a href="{{post.team_url}}">{{post.team}}</a> {% endif % }
11
12
</div>
12
13
13
14
<div class="post">
14
- {{{ post.contents } }}
15
+ {{ post.contents }}
15
16
</div>
16
17
</div>
17
18
</section>
18
- {{/inline}}
19
- {{~> layout~}}
19
+ {%- endblock page %}
You can’t perform that action at this time.
0 commit comments