From beb1306a1d4c5389946c45465a10f6a1f4d0019e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 4 Apr 2019 13:59:07 +0200 Subject: [PATCH] Move warnings before toc to fix toc placement The placement was off for pages with warnings. --- blog/templates/first-edition/page.html | 9 +++++---- blog/templates/second-edition/page.html | 15 ++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/blog/templates/first-edition/page.html b/blog/templates/first-edition/page.html index 28fb230a..5653fa0e 100644 --- a/blog/templates/first-edition/page.html +++ b/blog/templates/first-edition/page.html @@ -11,10 +11,6 @@ {% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %} -
- No longer updated! You are viewing the a post of the first edition of “Writing an OS in Rust”, which is no longer updated. You can find the second edition here. -
- + +
+ No longer updated! You are viewing the a post of the first edition of “Writing an OS in Rust”, which is no longer updated. You can find the second edition here. +
+ {{ page.content | safe }} {% endblock main %} diff --git a/blog/templates/second-edition/page.html b/blog/templates/second-edition/page.html index 6b4a13d0..02055d11 100644 --- a/blog/templates/second-edition/page.html +++ b/blog/templates/second-edition/page.html @@ -14,13 +14,6 @@ {% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %} - {% if page.extra.warning %} -
- {% if page.extra.warning_short %} {{ page.extra.warning_short }} {% endif %} - {{ page.extra.warning | markdown(inline=true)}} -
- {% endif %} - + + {% if page.extra.warning %} +
+ {% if page.extra.warning_short %} {{ page.extra.warning_short }} {% endif %} + {{ page.extra.warning | markdown(inline=true)}} +
+ {% endif %} + {{ page.content | safe | replace(from="", to=macros::toc(toc=toc))}}