mirror of
https://github.com/godotengine/godot-website.git
synced 2026-01-05 10:10:00 +03:00
Highlight recent post dates on homepage and article metadata (#793)
- Display post dates on homepage. This helps make recent articles more noticeable. The highlight is applied to post dates less than 48 hours old on the client side.
This commit is contained in:
@@ -82,6 +82,13 @@
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
|
||||
document.querySelectorAll('[data-post-date]').forEach((postDate) => {
|
||||
// Highlight post dates that are less than 48 hours old.
|
||||
if (Date.parse(postDate.dataset.postDate) > (Date.now() - 1000 * 60 * 60 * 96)) {
|
||||
postDate.classList.add("post-recent-highlight");
|
||||
};
|
||||
});
|
||||
|
||||
// Initialize lightbox.
|
||||
new Tobii({
|
||||
zoom: false,
|
||||
|
||||
Reference in New Issue
Block a user