diff --git a/_config.yml b/_config.yml index 93ab7add8b..85670301d0 100644 --- a/_config.yml +++ b/_config.yml @@ -23,6 +23,7 @@ icon: /images/icon-192x192.png keywords: author: Kristof Zerbe photo: /images/kristof-zerbe.png +avatar: /images/kristof-zerbe-400.jpg email: kristof.zerbe@gmail.com profiles: mastodon: https://indieweb.social/@kiko diff --git a/scripts/generators/generator-dynamic-about.js b/scripts/generators/generator-dynamic-about.js index a405c41465..c11d62c76c 100644 --- a/scripts/generators/generator-dynamic-about.js +++ b/scripts/generators/generator-dynamic-about.js @@ -1,16 +1,32 @@ const log = require('hexo-log')({ debug: false, silent: false }); const { magenta } = require('chalk'); const path = require('path'); +const fs = require("hexo-fs"); +// const { config } = require('process'); + +const _rootDir = hexo.source_dir.replace("source", ""); hexo.extend.generator.register("dynamic-about", async function(locals) { log.info("Generating Dynamic Page " + magenta("ABOUT") + " ..."); + let config = this.config; + + let result = []; + let page = locals.dynamic.about; - return { + result.push({ data: page, path: path.join(page.name, "index.html"), layout: "about" - }; + }); + + // Copy Avatar -> see https://blog.jim-nielsen.com/2023/well-known-avatar/ + /* TODO: Doesn't work this way. File has to return a true JPEG from web server */ + // log.info("Generating File " + magenta(".well-known/avatar")); + // let source = path.join(_rootDir, config.static_dir, config.avatar); + // let target = path.join(hexo.public_dir, ".well-known/avatar"); + // fs.copyFile(source, target); + return result; }); diff --git a/scripts/generators/generator-dynamic-blogroll.js b/scripts/generators/generator-dynamic-blogroll.js index 22f226e7d5..a14868b300 100644 --- a/scripts/generators/generator-dynamic-blogroll.js +++ b/scripts/generators/generator-dynamic-blogroll.js @@ -52,7 +52,7 @@ hexo.extend.generator.register("dynamic-blogroll", async function(locals) { let feedItem = json.items[0]; item.latest_post = { "url": feedItem.url, - "title": feedItem.title, + "title": feedItem.title || "- no title -", "date_published": feedItem.date_published }; } else { @@ -80,6 +80,8 @@ hexo.extend.generator.register("dynamic-blogroll", async function(locals) { }); // Render Blogroll OPML by template and add to result + log.info("Generating File " + magenta(config.blogroll.opml_path)); + const opmlTemplate = path.join(_rootDir, config.template_dir, config.blogroll.opml_template); if (!fs.existsSync(opmlTemplate)) { throw "Blogroll OPML template file not found"; } diff --git a/scripts/generators/generator-dynamic-feeds.js b/scripts/generators/generator-dynamic-feeds.js index 1b4c0a8082..97397913ad 100644 --- a/scripts/generators/generator-dynamic-feeds.js +++ b/scripts/generators/generator-dynamic-feeds.js @@ -89,6 +89,8 @@ hexo.extend.generator.register("dynamic-feeds", async function(locals) { }); //Render Feed OPML by template and add to result + log.info("Generating File " + magenta(config.feed.opml_path)); + const opmlTemplate = path.join(_rootDir, config.template_dir, config.feed.opml_template); if (!fs.existsSync(opmlTemplate)) { throw "Feed OPML template file not found"; } diff --git a/scripts/generators/generator-notes.js b/scripts/generators/generator-notes.js index 12929eda93..4f5f397d5d 100644 --- a/scripts/generators/generator-notes.js +++ b/scripts/generators/generator-notes.js @@ -8,6 +8,8 @@ const sharp = require("sharp"); // const { config } = require("process"); hexo.extend.generator.register("notes", function (locals) { + log.info("Generating Pages for " + magenta("NOTES") + " ..."); + let config = this.config; let notesDir = path.join(config.source_dir, "_" + config.notes_dir); let currentYear = new Date().getFullYear(); @@ -15,8 +17,6 @@ hexo.extend.generator.register("notes", function (locals) { // collection of pages to render let result = []; - log.info("Generating Pages for " + magenta("NOTES") + " ..."); - let years = fs .readdirSync(notesDir) .filter((entry) => fs.statSync(path.join(notesDir, entry)).isDirectory()) diff --git a/scripts/generators/generator-wellknown-webfinger.js b/scripts/generators/generator-wellknown-webfinger.js index 55e0b5749d..2bac1f5b45 100644 --- a/scripts/generators/generator-wellknown-webfinger.js +++ b/scripts/generators/generator-wellknown-webfinger.js @@ -3,7 +3,6 @@ const { magenta } = require('chalk'); const axios = require("axios"); hexo.extend.generator.register("wellknown-webfinger", async function() { - log.info("Generating File " + magenta(".well-known/webfinger")); let mastodonUrl = this.config.profiles.mastodon.split("@"); diff --git a/source/_dynamic/blogroll.md b/source/_dynamic/blogroll.md index 5fa9250d3e..4d65909516 100644 --- a/source/_dynamic/blogroll.md +++ b/source/_dynamic/blogroll.md @@ -9,7 +9,7 @@ teaser: >- Great people who write stuff on the internet that I follow, either on Mastodon or via feed date: 2024-06-04 18:29:29 -updated: 2024-07-17 21:29:59 +updated: 2024-07-22 11:13:28 --- I think everyone who runs a blog also reads a lot of other blogs. So do I. Be it via feed reader or via links in Mastodon posts. Some of these posts that I come across every day are pure gold and inspire me to try out the things mentioned there immediately ... or at least save them in my "must-do" list for later.