-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamic date on blog pages #5801
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c509397
fix NavPluginOrder warning on docs local preview
prushh 9b270f3
show non-hardcoded date on blog posts
prushh 79befb8
exclude date from blog homepage
prushh 3fb760f
add dates to all blog post
prushh 32608bb
fix titles on steering committee section
prushh c4006d5
show only revised or published date, remove styling from template
prushh 4b3e219
delete hard-coded dates, fix RabbitMQ article
prushh 7e13235
link content.css stylesheet
prushh 57c719a
fixup on revised and published date
prushh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- 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"> | ||
{{ toc_item.title }} | ||
<a class="headerlink" href="{{ toc_item.url }}" title="Permanent link">¶</a> | ||
</h1> | ||
{% endfor %} | ||
{% elif page.title %} | ||
<h1> | ||
{{ page.title }} | ||
</h1> | ||
{% endif %} | ||
|
||
{% include "partials/source-file.html" %} | ||
|
||
<!-- Page content --> | ||
{{ page.content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% if page.meta.git_creation_date_localized and page.meta.git_revision_date_localized %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick suggestion: Let's only show 'Revised on' for posts that have been updated. If it's not edited since posting, we'll skip this part to keep things clear and simple. How does that sound? |
||
<!-- Source file information --> | ||
<!-- 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 }} | ||
, | ||
Revised on: | ||
{{ page.meta.git_revision_date_localized }} | ||
</strong> | ||
</p> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think this approach is okay for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where should I move the styling? Is it okay to create the new /overrides/assets/stylesheets/content.css file to avoid problems with docs website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think that's a good idea and can explain the reason why this change is worthy, why not? :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think separating CSS from the HTML template is a good practice, as is separating CSS rules based on the files in which they act. For this reason, I will create the file /overrides/assets/stylesheets/content.css that is used only by the /overrides/partials/content.html file and doesn't interact with the docs website 😄 I will also remove the date from blog posts in which it is featured!