+
+This blog series creates a small operating system in the [Rust programming language](https://www.rust-lang.org/). Each post is a small tutorial and includes all needed code, so you can follow along if you like. The source code is also available in the corresponding [Github repository](https://github.com/phil-opp/blog_os).
+
+Latest post:
+
+
diff --git a/blog/templates/edition-1/index.html b/blog/templates/edition-1/index.html
index 31d4aae7..0d8a68ab 100644
--- a/blog/templates/edition-1/index.html
+++ b/blog/templates/edition-1/index.html
@@ -1,6 +1,6 @@
{% extends "edition-1/base.html" %}
-{% import "macros.html" as macros %}
+{% import "edition-1/macros.html" as macros %}
{% block title %}{{ config.title }}{% endblock title %}
diff --git a/blog/templates/edition-1/macros.html b/blog/templates/edition-1/macros.html
new file mode 100644
index 00000000..a6197dad
--- /dev/null
+++ b/blog/templates/edition-1/macros.html
@@ -0,0 +1,39 @@
+{% macro post_link(page) %}
+ {% set translations = page.translations | filter(attribute="lang", value=lang) -%}
+ {%- if translations -%}
+ {%- set post = get_page(path = translations.0.path) -%}
+ {%- else -%}
+ {%- set post = page -%}
+ {%- set not_translated = true -%}
+ {%- endif -%}
+
+
+{% endmacro toc %}
diff --git a/blog/templates/edition-1/section.html b/blog/templates/edition-1/section.html
index 3bbe0a8a..45d12fa3 100644
--- a/blog/templates/edition-1/section.html
+++ b/blog/templates/edition-1/section.html
@@ -1,6 +1,6 @@
{% extends "edition-1/base.html" %}
-{% import "macros.html" as macros %}
+{% import "edition-1/macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
diff --git a/blog/templates/edition-2/extra.html b/blog/templates/edition-2/extra.html
index bdd5a16a..93c98f59 100644
--- a/blog/templates/edition-2/extra.html
+++ b/blog/templates/edition-2/extra.html
@@ -1,6 +1,6 @@
{% extends "edition-2/base.html" %}
-{% import "macros.html" as macros %}
+{% import "snippets.html" as snippets %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
@@ -17,6 +17,6 @@
Comments
- {{ macros::utterances() }}
+ {{ snippets::utterances() }}
{% endblock after_main %}
diff --git a/blog/templates/edition-2/index.html b/blog/templates/edition-2/index.html
index b8303d4b..4c893f5c 100644
--- a/blog/templates/edition-2/index.html
+++ b/blog/templates/edition-2/index.html
@@ -1,6 +1,7 @@
{% extends "edition-2/base.html" %}
-{% import "macros.html" as macros %}
+{% import "edition-2/macros.html" as macros %}
+{% import "snippets.html" as snippets %}
{% block title %}{{ config.title }}{% endblock title %}
@@ -8,20 +9,10 @@
{% set posts_section = get_section(path = "edition-2/posts/_index.md") %}
{% set posts = posts_section.pages %}
-
Writing an OS in Rust
-
-
-
- This blog series creates a small operating system in the
- Rust programming language. Each post is a small tutorial and includes all
- needed code, so you can follow along if you like. The source code is also available in the corresponding
- Github repository.
-