-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
034e00f
commit 276090e
Showing
3 changed files
with
16 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
<ul> | ||
{% for post in site.posts %} | ||
|
||
{% assign post_date = post.date | date: site.theme_config.date_format %} | ||
<li> | ||
{{ post.date | date: site.theme_config.date_format }} <a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a> | ||
<div class="new" data-post-date="{{ post_date}}">{{ post_date }} <a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a></div> | ||
</li> | ||
|
||
{% endfor %} | ||
</ul> | ||
|
||
<script type="text/javascript"> | ||
let posts = document.getElementsByClassName("new"); | ||
const now = moment(); | ||
for (let post_date of posts) { | ||
let pdate = moment(post_date.dataset.postDate); | ||
if (now.isoWeek() == pdate.isoWeek()) { | ||
post_date.innerHTML = "<b>[new!]</b> " + post_date.textContent; | ||
} | ||
} | ||
</script> |
Large diffs are not rendered by default.
Oops, something went wrong.