From 39c1f209dc7eac900c1907f2381e2f2662631d58 Mon Sep 17 00:00:00 2001 From: Kristof Zerbe Date: Mon, 28 Oct 2024 17:12:02 +0100 Subject: [PATCH] MentionsUnited: Multiple syndication for Pixeldfed --- .../generators/generator-dynamic-blogroll.js | 6 +++-- .../layout/_partial/post/interaction.ejs | 19 ++++++++------- themes/landscape/source/js/mentions-united.js | 23 ++++++++++++++++--- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/scripts/generators/generator-dynamic-blogroll.js b/scripts/generators/generator-dynamic-blogroll.js index 0ff2b7051f..f9c8f67811 100644 --- a/scripts/generators/generator-dynamic-blogroll.js +++ b/scripts/generators/generator-dynamic-blogroll.js @@ -75,12 +75,14 @@ hexo.extend.generator.register("dynamic-blogroll", async function(locals) { } else { log.error("Fetching feed from " + item.title + " responded with status " + response.status); item.errorStatus = response.status; - if (item.errorStatus === 403) { console.log(response); } + if (item.errorStatus === 403) { + //console.log(response); + } } resolve(); }).catch(err => { log.error("Fetching feed from " + item.title + " failed"); - console.log(err); + //console.log(err); resolve(); // Resolve anyway, to suppress errors }); })); diff --git a/themes/landscape/layout/_partial/post/interaction.ejs b/themes/landscape/layout/_partial/post/interaction.ejs index 89358e91e8..2d557d4c05 100644 --- a/themes/landscape/layout/_partial/post/interaction.ejs +++ b/themes/landscape/layout/_partial/post/interaction.ejs @@ -1,7 +1,10 @@ <% let syndications = post.syndication?.filter(s => s.url?.length > 0 && s.host?.length > 0) let synDevTo = syndications?.find(s => s.host.toLowerCase() === "devto"); - let synPixelfed = syndications?.find(s => s.host.toLowerCase() === "pixelfed"); + let synPixelfed = syndications?.filter(s => s.host.toLowerCase() === "pixelfed"); + let synLemmy = syndications?.filter(s => s.host.toLowerCase() === "lemmy"); + + //console.log("---------------\n" + post.title + ": " + synPixelfed.length); %>
@@ -56,7 +59,7 @@ <%- js('js/mentions-united-renderer_avatars-by-type.js') %> <%- js('js/mentions-united-renderer_list.js') %> <% if (synDevTo) { %><%- js('js/mentions-united-provider_devto.js'); %><% } %> - <% if (synPixelfed) { %><%- js('js/mentions-united-provider_pixelfed.js'); %><% } %> + <% if (synPixelfed?.length > 0) { %><%- js('js/mentions-united-provider_pixelfed.js'); %><% } %>