Fix time in webmentions
This commit is contained in:
parent
4a9c8b0292
commit
1279d9307c
@ -77,7 +77,7 @@ const getNotes = async (opts) => {
|
|||||||
url: `https://yarmo.eu/post/${fm.slug}`,
|
url: `https://yarmo.eu/post/${fm.slug}`,
|
||||||
slug: fm.slug,
|
slug: fm.slug,
|
||||||
date: fm.date,
|
date: fm.date,
|
||||||
date_formatted: DateTime.fromFormat(fm.date, 'yyyy-LL-dd hh:mm:ss').setLocale("en").toLocaleString(DateTime.DATE_MED),
|
date_formatted: DateTime.fromFormat(fm.date, 'yyyy-LL-dd hh:mm:ss').setLocale("en").setZone('utc').toLocaleString(DateTime.DATE_MED),
|
||||||
published: fm.published,
|
published: fm.published,
|
||||||
discussion: fm.discussion,
|
discussion: fm.discussion,
|
||||||
content: md.render(fm.__content)
|
content: md.render(fm.__content)
|
||||||
@ -104,7 +104,15 @@ const getWebmentions = async (url) => {
|
|||||||
const data_1 = await getJSON(`https://webm.yarmo.eu/get?target=${url}`)
|
const data_1 = await getJSON(`https://webm.yarmo.eu/get?target=${url}`)
|
||||||
const data_2 = await getJSON(`https://webm.yarmo.eu/get?target=${url.replace('/post/', '/blog/')}`)
|
const data_2 = await getJSON(`https://webm.yarmo.eu/get?target=${url.replace('/post/', '/blog/')}`)
|
||||||
const data_3 = await getJSON(`https://webm.yarmo.eu/get?target=${url.replace('/post/', '/notes/')}`)
|
const data_3 = await getJSON(`https://webm.yarmo.eu/get?target=${url.replace('/post/', '/notes/')}`)
|
||||||
return data_1.concat(data_2).concat(data_3)
|
|
||||||
|
const dataRaw = data_1.concat(data_2).concat(data_3)
|
||||||
|
const data = _.map(dataRaw, (x) => {
|
||||||
|
x.date = DateTime.fromISO(x.created_at).setLocale("en").setZone('utc').toLocaleString(DateTime.DATE_MED),
|
||||||
|
x.time = DateTime.fromISO(x.created_at).setLocale("en").setZone('utc').toLocaleString(DateTime.TIME_24_WITH_SHORT_OFFSET)
|
||||||
|
return x
|
||||||
|
})
|
||||||
|
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRSS = async (opts) => {
|
const getRSS = async (opts) => {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ mixin webmention(item)
|
|||||||
if ('date' in item)
|
if ('date' in item)
|
||||||
| on !{item.date}
|
| on !{item.date}
|
||||||
if ('time' in item)
|
if ('time' in item)
|
||||||
| at !{item.time} UTC
|
| at !{item.time}
|
||||||
else if (item.type == "comment")
|
else if (item.type == "comment")
|
||||||
.comment
|
.comment
|
||||||
p.quote
|
p.quote
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user