From 168b59890147f0a991d63b33b9c99f1f9a273525 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 2 May 2017 08:49:50 +0200 Subject: [PATCH] Create gutenberg templates --- blog/templates/base.html | 41 ++++++++++++++ .../handling-exceptions-with-naked-fns.html | 11 ++++ blog/templates/index.html | 54 +++++++++++++++++++ blog/templates/macros.html | 10 ++++ blog/templates/page.html | 23 ++++++++ blog/templates/section.html | 19 +++++++ 6 files changed, 158 insertions(+) create mode 100644 blog/templates/base.html create mode 100644 blog/templates/handling-exceptions-with-naked-fns.html create mode 100644 blog/templates/index.html create mode 100644 blog/templates/macros.html create mode 100644 blog/templates/page.html create mode 100644 blog/templates/section.html diff --git a/blog/templates/base.html b/blog/templates/base.html new file mode 100644 index 00000000..acb7fdb9 --- /dev/null +++ b/blog/templates/base.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + {% block title %}{% endblock title %} + + + +
+
+

+ {{ config.title }} + {{ config.extra.subtitle }} +

+
+ +
{% block main %}{% endblock main %}
+ +
{% block after_main %}{% endblock after_main %}
+ +
+
+ + © . All rights reserved. + Contact + +
+
+ + + diff --git a/blog/templates/handling-exceptions-with-naked-fns.html b/blog/templates/handling-exceptions-with-naked-fns.html new file mode 100644 index 00000000..55cc88fd --- /dev/null +++ b/blog/templates/handling-exceptions-with-naked-fns.html @@ -0,0 +1,11 @@ +{% extends "section.html" %} + +{% block title %}{{ super() }}{% endblock title %} + +{% block main %}{{ super() }}{% endblock main %} + +{% block introduction %} + +

These posts explain how to handle CPU exceptions using naked functions. Historically, these posts were the main exception handling posts before the x86-interrupt calling convention and the x86_64 crate existed. Our new way of handling exceptions can be found in the “Handling Exceptions” post.

+ +{% endblock introduction %} diff --git a/blog/templates/index.html b/blog/templates/index.html new file mode 100644 index 00000000..c09910f0 --- /dev/null +++ b/blog/templates/index.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% import "macros.html" as macros %} + +{% block title %}{{ config.title }}{% endblock title %} + +{% block main %} +
+

+ 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. +

+

Latest post: + {{ macros::latest_post_link(page=pages|reverse|last) }} +

+
+ +
Bare Bones
+
+ {{ macros::post_link(page=pages.9) }} + {{ macros::post_link(page=pages.8) }} + {{ macros::post_link(page=pages.7) }} + {{ macros::post_link(page=pages.6) }} +
+ +
Memory Management
+
+ {{ macros::post_link(page=pages.5) }} + {{ macros::post_link(page=pages.4) }} + {{ macros::post_link(page=pages.3) }} + {{ macros::post_link(page=pages.2) }} +
+ +
Exceptions
+
+ {{ macros::post_link(page=pages.1) }} + {{ macros::post_link(page=pages.0) }} +
+ +
+

Additional Resources

+ + + +
+ + +{% endblock main %} diff --git a/blog/templates/macros.html b/blog/templates/macros.html new file mode 100644 index 00000000..cc953a62 --- /dev/null +++ b/blog/templates/macros.html @@ -0,0 +1,10 @@ +{% macro post_link(page) %} +
+

{{ page.title }}

+ {{ page.summary | safe }} +
+{% endmacro post_link %} + +{% macro latest_post_link(page) %} + {{ page.title }} +{% endmacro latest_post_link %} diff --git a/blog/templates/page.html b/blog/templates/page.html new file mode 100644 index 00000000..1ae18660 --- /dev/null +++ b/blog/templates/page.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %} + +{% block main %} +

{{ page.title }}

+ {{ page.content | safe }} +{% endblock main %} + +{% block after_main %} +
+ +{% endblock after_main %} + + diff --git a/blog/templates/section.html b/blog/templates/section.html new file mode 100644 index 00000000..3b879148 --- /dev/null +++ b/blog/templates/section.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% import "macros.html" as macros %} + +{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %} + +{% block main %} + +

{{ section.title }}

+ +{% block introduction %}{% endblock introduction %} + +
+ {% for page in section.pages %} + {{ macros::post_link(page=page) }} + {% endfor %} +
+ +{% endblock main %}