{{ post.title }}
{{ post.excerpt }}
+ {{ post.date | date: "%e %B %Y" }}diff --git a/_includes/footer.html b/_includes/footer.html index 6b54eb62fc..4d0a97f3cf 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -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, diff --git a/_layouts/article.html b/_layouts/article.html index 2f07e4797e..1ff0429b41 100644 --- a/_layouts/article.html +++ b/_layouts/article.html @@ -115,6 +115,19 @@ layout: default color: var(--base-color-text-subtitle-date); } + .article-metadata .date.post-recent-highlight { + color: var(--post-recent-highlight-color); + opacity: 0.8; + } + + .article-metadata .date.post-recent-highlight::after { + font-size: 80%; + content: "NEW"; + border: 2px solid var(--post-recent-highlight-color); + padding: 2px 3px; + margin-left: 8px; + } + .tag.active { filter: saturate(0.75); } @@ -176,7 +189,7 @@ layout: default {% endif %} {{ page.author }} - {{ page.date | date: "%e %B %Y" }} + {{ page.date | date: "%e %B %Y" }}