Skip to content

Commit

Permalink
show only revised or published date, remove styling from template
Browse files Browse the repository at this point in the history
  • Loading branch information
prushh committed Jan 9, 2024
1 parent 32608bb commit c4006d5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions blog/overrides/assets/stylesheets/content.css
Original file line number Diff line number Diff line change
@@ -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;
}
10 changes: 1 addition & 9 deletions blog/overrides/partials/content.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<!-- based on https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/partials/content.html -->

<style>
.md-typeset h1:nth-of-type(2),
.md-content__button:nth-of-type(2) {
display: none;
}
</style>


{% if page.toc %}
{% for toc_item in page.toc %}
<h1 id="TODO">
<h1 id="{{ toc_item.url[1::] }}">
{{ toc_item.title }}
<a class="headerlink" href="{{ toc_item.url }}" title="Permanent link"></a>
</h1>
Expand Down
16 changes: 9 additions & 7 deletions blog/overrides/partials/source-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<!-- based on https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/howto/override-a-theme -->

<p class="md-source-file">
<strong>
Published on:
{{ page.meta.git_creation_date_localized }}
,&nbsp;
Revised on:
{{ page.meta.git_revision_date_localized }}
</strong>
<strong>
{% 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 %}
</strong>
</p>
{% endif %}

0 comments on commit c4006d5

Please sign in to comment.