From c4006d51628930e971cfba9dd4b5173edd1fc1a3 Mon Sep 17 00:00:00 2001 From: prushh Date: Tue, 9 Jan 2024 18:25:31 +0100 Subject: [PATCH] show only revised or published date, remove styling from template --- .gitignore | 5 +++++ blog/overrides/assets/stylesheets/content.css | 5 +++++ blog/overrides/partials/content.html | 10 +--------- blog/overrides/partials/source-file.html | 16 +++++++++------- 4 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 blog/overrides/assets/stylesheets/content.css diff --git a/.gitignore b/.gitignore index 0f3f9785a5..314dc06539 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,11 @@ hack/__pycache__ /blog/site/ !/blog/overrides/ /blog/overrides/* +!/blog/overrides/assets/ +/blog/overrides/assets/* +!/blog/overrides/assets/stylesheets +/blog/overrides/assets/stylesheets/* +!/blog/overrides/assets/stylesheets/content.css !/blog/overrides/partials/ /blog/overrides/partials/* !/blog/overrides/partials/source-file.html diff --git a/blog/overrides/assets/stylesheets/content.css b/blog/overrides/assets/stylesheets/content.css new file mode 100644 index 0000000000..1bacc1f34b --- /dev/null +++ b/blog/overrides/assets/stylesheets/content.css @@ -0,0 +1,5 @@ +/* hack to hide blog posts title */ +.md-typeset h1:nth-of-type(2), +.md-content__button:nth-of-type(2) { + display: none; +} \ No newline at end of file diff --git a/blog/overrides/partials/content.html b/blog/overrides/partials/content.html index a2fe3795e2..917def9b38 100644 --- a/blog/overrides/partials/content.html +++ b/blog/overrides/partials/content.html @@ -1,16 +1,8 @@ - - - {% if page.toc %} {% for toc_item in page.toc %} -

+

{{ toc_item.title }} ΒΆ

diff --git a/blog/overrides/partials/source-file.html b/blog/overrides/partials/source-file.html index a56a49ea79..5842d3ed83 100644 --- a/blog/overrides/partials/source-file.html +++ b/blog/overrides/partials/source-file.html @@ -3,12 +3,14 @@

- - Published on: - {{ page.meta.git_creation_date_localized }} - ,  - Revised on: - {{ page.meta.git_revision_date_localized }} - + + {% if page.meta.git_creation_date_localized == page.meta.git_revision_date_localized%} + Published on: + {{ page.meta.git_creation_date_localized }} + {% else %} + Revised on: + {{ page.meta.git_revision_date_localized }} + {% endif %} +

{% endif %}