Skip to content

Commit

Permalink
chore(gh-pages): update date semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
fshovchko committed Jun 28, 2023
1 parent 758994b commit 406098f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pages/11ty/date.filter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = (config) => {
const date = (timestamp) =>
new Intl.DateTimeFormat('UTC', { month: 'long', day: '2-digit', year: 'numeric' }).format(new Date(timestamp));
const date = (timestamp) =>
new Intl.DateTimeFormat('UTC', { month: 'long', day: '2-digit', year: 'numeric' }).format(new Date(timestamp));

module.exports = (config) => {
config.addFilter('date', date);
};
7 changes: 1 addition & 6 deletions pages/11ty/markdown.shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ class MDRenderer {
}

static renderContent(content) {
return MDRenderer.renderContentString(content.innerHTML);
}

static renderContentString(str) {
return `<div class="markdown-container">${str}</div>`;
return `<div class="markdown-container">${content.innerHTML}</div>`;
}

static resolveLinks(dom, basePath) {
Expand All @@ -79,6 +75,5 @@ class MDRenderer {

module.exports = (config) => {
config.addNunjucksAsyncShortcode('mdRender', MDRenderer.render);
config.addNunjucksShortcode('mdWrap', MDRenderer.renderContentString);
};
module.exports.MDRenderer = MDRenderer;
6 changes: 2 additions & 4 deletions pages/views/_includes/landing/newsline.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
<a class="newsline-content" href="{{ item.data.link or (item.url | url) }}">
<h4 class="newsline-content-name">{{ item.data.emoji }}{{ item.data.name }}</h4>
{% if item.data.date %}
<time class="newsline-content-date">{{ item.date | date }}</time>
<time class="newsline-content-date" datetime="{{ item.date.toISOString() }}">{{ item.date | date }}</time>
{% endif %}
<div class="newsline-content-text">
{% mdWrap item.templateContent %}
</div>
<div class="newsline-content-text markdown-container">{{ item.templateContent | safe }}</div>
</a>
</li>
{% endfor %}
Expand Down

0 comments on commit 406098f

Please sign in to comment.