Skip to content

Commit 9e93870

Browse files
committed
Tweak templates
These tweaks make the output more similar to the one of the custom SSG, allowing easier diffing between the two setups.
1 parent bb05bd3 commit 9e93870

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

content/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ This is the <b>main Rust blog</b>. \
99
<a href="https://www.rust-lang.org/governance/">Rust teams</a> \
1010
use this blog to announce major developments in the world of Rust."""
1111
maintained_by = "the Rust Teams"
12-
see_also_path = "inside-rust/"
12+
see_also_path = "/inside-rust/"
1313
see_also_text = """the "Inside Rust" blog"""
1414
+++

content/inside-rust/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ to follow along with Rust development. The various \
1111
use this blog to post status updates, calls for help, and other \
1212
similar announcements."""
1313
maintained_by = "the Rust Teams"
14-
see_also_path = ""
14+
see_also_path = "/"
1515
see_also_text = "the main Rust blog"
1616
+++

templates/headers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<meta name="theme-color" content="#ffffff">
3737

3838
<!-- atom -->
39-
<link type="application/atom+xml" rel="alternate" href="https://blog.rust-lang.org/{{ section.path }}feed.xml" title="{{ section.title }}" />
39+
<link type="application/atom+xml" rel="alternate" href="https://blog.rust-lang.org{{ section.path | safe }}feed.xml" title="{{ section.title }}" />
4040

4141
<!-- theme switcher -->
4242
<script src="{{ config.base_url | safe }}/scripts/theme-switch.js"></script>

templates/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{% import "macros.html" as macros %}
2-
{% extends "layout.html" %}
3-
{% block page %}
1+
{% import "macros.html" as macros -%}
2+
{% extends "layout.html" -%}
3+
{% block page -%}
44
<header class="mt3 mt0-ns mb4-ns">
55
<div class="container flex flex-column flex-row-l justify-between-l">
66
<div class="mw6-l">
@@ -11,7 +11,7 @@
1111
<div class="mw8-l">
1212
<p>
1313
<b>See also:</b>
14-
<a href="{{ config.base_url }}/{{ section.extra.see_also_path }}">{{ section.extra.see_also_text }}</a>
14+
<a href="{{ config.base_url | safe }}{{ section.extra.see_also_path | safe }}">{{ section.extra.see_also_text }}</a>
1515
</p>
1616
</div>
1717
</div>
@@ -42,7 +42,7 @@
4242
</tr>{% endif %}
4343
<tr>
4444
<td class="tr o-60 pr4 pr5-l bn">{{ macros::month_name(num=month) }}&nbsp;{{ day }}</td>
45-
<td class="bn"><a href="{{ config.base_url }}{{ page.path }}">{{ macros::escape_hbs(input=page.title) }}</a></td>
45+
<td class="bn"><a href="{{ config.base_url | safe }}{{ page.path | safe }}">{{ macros::escape_hbs(input=page.title) }}</a></td>
4646
</tr>
4747
{%- endfor %}
4848
</table>

templates/layout.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
{% import "macros.html" as macros %}
2-
{% import "headers.html" as headers %}
3-
{% import "nav.html" as nav %}
4-
{% import "footer.html" as footer %}
1+
{% import "macros.html" as macros -%}
2+
{% import "headers.html" as headers -%}
3+
{% import "nav.html" as nav -%}
4+
{% import "footer.html" as footer -%}
55

6-
{% if page %}
7-
{% set section = get_section(path=(page.ancestors | last)) %}
8-
{% set title = page.title ~ " | " ~ section.title %}
9-
{% else %}
10-
{% set title = section.extra.index_title %}
11-
{% endif %}
6+
{% if page -%}
7+
{% set section = get_section(path=(page.ancestors | last)) -%}
8+
{% set title = page.title ~ " | " ~ section.title -%}
9+
{% else -%}
10+
{% set title = section.extra.index_title -%}
11+
{% endif -%}
1212
<!DOCTYPE html>
1313
<html lang="en">
1414
<head>

templates/nav.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% macro nav(section) -%}
22
<nav class="flex flex-row justify-center justify-end-l items-center flex-wrap ph2 pl3-ns pr4-ns">
33
<div class="brand flex-auto w-100 w-auto-l self-start tc tl-l">
4-
<a href="{{ config.base_url | safe }}/{{ section.path }}">
4+
<a href="{{ config.base_url | safe }}{{ section.path | safe }}">
55
<img class="v-mid ml0-l rust-logo" alt="Rust Logo" src="{{ config.base_url | safe }}/images/rust-logo-blk.svg">
66
<span class="dib ml1 ml0-l">{{ section.title }}</span>
77
</a>

templates/page.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{% import "macros.html" as macros %}
2-
{% extends "layout.html" %}
3-
{% block page %}
1+
{% import "macros.html" as macros -%}
2+
{% extends "layout.html" -%}
3+
{% block page -%}
44
{% set year = page.components[0] | int -%}
55
{% set month = page.components[1] | int -%}
66
{% set day = page.components[2] | int -%}
@@ -12,7 +12,7 @@ <h2>{{ macros::escape_hbs(input=page.title) }}</h2>
1212
</header>
1313

1414
<div class="publish-date-author">{{ macros::month_name(num=month) }} {{ day }}, {{ year }} &middot; {{ macros::escape_hbs(input=page.authors | join(sep=", ")) }}
15-
{% if page.extra is containing("team") %} on behalf of <a href="{{ page.extra.team_url }}">{{ page.extra.team }}</a> {% endif %}
15+
{% if page.extra is containing("team") %} on behalf of <a href="{{ page.extra.team_url | safe }}">{{ page.extra.team }}</a> {% endif %}
1616
</div>
1717

1818
<div class="post">

0 commit comments

Comments
 (0)