From b4e0467878c7886db734e557dfe6716673e8639b Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 14 Nov 2021 08:22:57 +0100 Subject: [PATCH] Reverted page partials into a single one due to better performance --- material/base.html | 4 +-- material/partials/content.html | 18 +++++++++++++ material/partials/page-footer.html | 9 ------- material/partials/page-header.html | 8 ------ material/partials/page.html | 7 ------ src/base.html | 4 +-- src/partials/{page.html => content.html} | 20 +++++++++++++++ src/partials/page-footer.html | 29 --------------------- src/partials/page-header.html | 32 ------------------------ 9 files changed, 40 insertions(+), 91 deletions(-) create mode 100644 material/partials/content.html delete mode 100644 material/partials/page-footer.html delete mode 100644 material/partials/page-header.html delete mode 100644 material/partials/page.html rename src/partials/{page.html => content.html} (77%) delete mode 100644 src/partials/page-footer.html delete mode 100644 src/partials/page-header.html diff --git a/material/base.html b/material/base.html index fecad7962..e570671bb 100644 --- a/material/base.html +++ b/material/base.html @@ -160,9 +160,7 @@
{% block content %} - {% include "partials/page-header.html" %} - {% include "partials/page.html" %} - {% include "partials/page-footer.html" %} + {% include "partials/content.html" %} {% endblock %}
diff --git a/material/partials/content.html b/material/partials/content.html new file mode 100644 index 000000000..177364dbf --- /dev/null +++ b/material/partials/content.html @@ -0,0 +1,18 @@ +{#- + This file was automatically generated - do not edit +-#} +{% if page.edit_url %} + + {% include ".icons/material/pencil.svg" %} + +{% endif %} +{% if not "\x3ch1" in page.content %} +

{{ page.title | d(config.site_name, true)}}

+{% endif %} +{{ page.content }} +{% if page and page.meta and ( + page.meta.git_revision_date_localized or + page.meta.revision_date +) %} + {% include "partials/source-file.html" %} +{% endif %} diff --git a/material/partials/page-footer.html b/material/partials/page-footer.html deleted file mode 100644 index c1d58f8c1..000000000 --- a/material/partials/page-footer.html +++ /dev/null @@ -1,9 +0,0 @@ -{#- - This file was automatically generated - do not edit --#} -{% if page and page.meta and ( - page.meta.git_revision_date_localized or - page.meta.revision_date -) %} - {% include "partials/source-file.html" %} -{% endif %} diff --git a/material/partials/page-header.html b/material/partials/page-header.html deleted file mode 100644 index f454172b6..000000000 --- a/material/partials/page-header.html +++ /dev/null @@ -1,8 +0,0 @@ -{#- - This file was automatically generated - do not edit --#} -{% if page.edit_url %} - - {% include ".icons/material/pencil.svg" %} - -{% endif %} diff --git a/material/partials/page.html b/material/partials/page.html deleted file mode 100644 index b57ba9a94..000000000 --- a/material/partials/page.html +++ /dev/null @@ -1,7 +0,0 @@ -{#- - This file was automatically generated - do not edit --#} -{% if not "\x3ch1" in page.content %} -

{{ page.title | d(config.site_name, true)}}

-{% endif %} -{{ page.content }} diff --git a/src/base.html b/src/base.html index 35eb65b0a..417b584b5 100644 --- a/src/base.html +++ b/src/base.html @@ -292,9 +292,7 @@
{% block content %} - {% include "partials/page-header.html" %} - {% include "partials/page.html" %} - {% include "partials/page-footer.html" %} + {% include "partials/content.html" %} {% endblock %}
diff --git a/src/partials/page.html b/src/partials/content.html similarity index 77% rename from src/partials/page.html rename to src/partials/content.html index bb6d63b2a..97b467216 100644 --- a/src/partials/page.html +++ b/src/partials/content.html @@ -20,6 +20,18 @@ IN THE SOFTWARE. --> + +{% if page.edit_url %} + + {% include ".icons/material/pencil.svg" %} + +{% endif %} + + {{ page.content }} + + +{% if page and page.meta and ( + page.meta.git_revision_date_localized or + page.meta.revision_date +) %} + {% include "partials/source-file.html" %} +{% endif %} diff --git a/src/partials/page-footer.html b/src/partials/page-footer.html deleted file mode 100644 index 76a0b51e9..000000000 --- a/src/partials/page-footer.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -{% if page and page.meta and ( - page.meta.git_revision_date_localized or - page.meta.revision_date -) %} - {% include "partials/source-file.html" %} -{% endif %} diff --git a/src/partials/page-header.html b/src/partials/page-header.html deleted file mode 100644 index 3fa8bfd6f..000000000 --- a/src/partials/page-header.html +++ /dev/null @@ -1,32 +0,0 @@ - - - -{% if page.edit_url %} - - {% include ".icons/material/pencil.svg" %} - -{% endif %}