fix webmentions & css
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { DateTime } from "luxon";
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
|
||||
export default function(eleventyConfig) {
|
||||
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
|
||||
@@ -6,6 +7,10 @@ export default function(eleventyConfig) {
|
||||
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter('dateFromTimestamp', (timestamp) => {
|
||||
return DateTime.fromISO(timestamp, { zone: 'America/New_York' }).toJSDate()
|
||||
})
|
||||
|
||||
eleventyConfig.addFilter("htmlDateString", (dateObj) => {
|
||||
// dateObj input: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
|
||||
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat('yyyy-LL-dd');
|
||||
@@ -36,7 +41,7 @@ export default function(eleventyConfig) {
|
||||
const clean = (entry) => {
|
||||
const { html, text } = entry.content
|
||||
if (html) {
|
||||
entry.content.value = sanitizeHTML(text, allowedHTML)
|
||||
entry.content.value = sanitizeHtml(text, allowedHTML)
|
||||
};
|
||||
return entry;
|
||||
}
|
||||
@@ -82,6 +87,7 @@ export default function(eleventyConfig) {
|
||||
return mentions.filter(entry => !!entry['mentionType'])
|
||||
});
|
||||
|
||||
|
||||
// Return the smallest number argument
|
||||
eleventyConfig.addFilter("min", (...numbers) => {
|
||||
return Math.min.apply(null, numbers);
|
||||
@@ -97,3 +103,4 @@ export default function(eleventyConfig) {
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user