parent
53a3b98fa9
commit
7cd12f55fe
3 changed files with 2 additions and 9 deletions
|
@ -29,10 +29,6 @@ module.exports = {
|
||||||
if (image && image !== '') return image
|
if (image && image !== '') return image
|
||||||
return `${BASE_URL}/assets/img/social-card.jpg`
|
return `${BASE_URL}/assets/img/social-card.jpg`
|
||||||
},
|
},
|
||||||
getUserImage: (image) => {
|
|
||||||
if (image && image !== '') return image
|
|
||||||
return `http://localhost:8080/assets/img/media/missing-user.jpg`
|
|
||||||
},
|
|
||||||
getPopularPosts: (posts, analytics) => {
|
getPopularPosts: (posts, analytics) => {
|
||||||
return posts
|
return posts
|
||||||
.filter((post) => {
|
.filter((post) => {
|
||||||
|
@ -50,7 +46,6 @@ module.exports = {
|
||||||
'like-of': [],
|
'like-of': [],
|
||||||
'repost-of': [],
|
'repost-of': [],
|
||||||
'in-reply-to': [],
|
'in-reply-to': [],
|
||||||
'mention-of': [],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasRequiredFields = (entry) => {
|
const hasRequiredFields = (entry) => {
|
||||||
|
@ -60,7 +55,7 @@ module.exports = {
|
||||||
|
|
||||||
const filtered =
|
const filtered =
|
||||||
webmentions
|
webmentions
|
||||||
.filter((entry) => entry['wm-target'] === `${BASE_URL}${url}`)
|
.filter((entry) => entry['wm-target'].replace(utmPattern, '') === `${BASE_URL}${url}`)
|
||||||
.filter((entry) => allowedTypes.includes(entry['wm-property'])) || []
|
.filter((entry) => allowedTypes.includes(entry['wm-property'])) || []
|
||||||
|
|
||||||
filtered.forEach((m) => {
|
filtered.forEach((m) => {
|
||||||
|
@ -79,7 +74,6 @@ module.exports = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// data['in-reply-to'] = [...data['in-reply-to'], ...data['mention-of']]
|
|
||||||
data['in-reply-to'].sort((a, b) =>
|
data['in-reply-to'].sort((a, b) =>
|
||||||
a.published > b.published ? 1 : b.published > a.published ? -1 : 0
|
a.published > b.published ? 1 : b.published > a.published ? -1 : 0
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
{% for mention in mentions['in-reply-to'] %}
|
{% for mention in mentions['in-reply-to'] %}
|
||||||
<div class="border-bottom flex flex-row items-center border-gray-100 pb-4 w-full">
|
<div class="border-bottom flex flex-row items-center border-gray-100 pb-4 w-full">
|
||||||
<a class="text-gray-700 dark:text-gray-200 group flex flex-row space-between items-center" href={{mention.url}}>
|
<a class="text-gray-700 dark:text-gray-200 group flex flex-row space-between items-center" href={{mention.url}}>
|
||||||
{% assign photo = mention.author.photo | getUserImage %}
|
{% image mention.author.photo, mention.author.name, 'bg-gray-900 dark:bg-white h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all ease-in-out duration-300 group-hover:border-pink-500 dark:group-hover:border-pink-500', '56px' %}
|
||||||
{% image photo, mention.author.name, 'bg-gray-900 dark:bg-white h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all ease-in-out duration-300 group-hover:border-pink-500 dark:group-hover:border-pink-500', '56px' %}
|
|
||||||
<div class="ml-3">
|
<div class="ml-3">
|
||||||
<p class="text-sm group-hover:text-pink-500 dark:group-hover:text-pink-500">{{ mention.content.text }}</p>
|
<p class="text-sm group-hover:text-pink-500 dark:group-hover:text-pink-500">{{ mention.content.text }}</p>
|
||||||
<p class="mt-1 text-xs group-hover:text-pink-500 dark:group-hover:text-pink-500">{{ mention.published | isoDateOnly }}</p>
|
<p class="mt-1 text-xs group-hover:text-pink-500 dark:group-hover:text-pink-500">{{ mention.published | isoDateOnly }}</p>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
Reference in a new issue