diff --git a/_config.yml b/_config.yml
index 00b2e2c..e1f4f3b 100644
--- a/_config.yml
+++ b/_config.yml
@@ -64,6 +64,11 @@ index_generator:
per_page: 10
order_by: -date
+# Archive shows blog posts only (events are filtered out in the theme),
+# so keep it on one page to avoid short or empty pages.
+archive_generator:
+ per_page: 0
+
# Category & Tag
default_category: uncategorized
category_map:
@@ -91,6 +96,7 @@ pagination_dir: page
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
+ - rss2.xml # feed template (see feed.template), not a page
ignore:
# Extensions
@@ -107,6 +113,7 @@ feed:
enable: true
type: rss2
path: rss2.xml
+ template: ./source/rss2.xml
limit: 15
hub:
content:
diff --git a/package-lock.json b/package-lock.json
index 3d515a3..47811e0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -20,6 +20,8 @@
"hexo-renderer-stylus": "^3.0.1",
"hexo-server": "^3.0.0",
"hexo-theme-landscape": "^1.0.0",
+ "lucide-static": "^1.52.0",
+ "simple-icons": "^16.34.0",
"strip-ansi": "^6.0.1"
}
},
@@ -2049,6 +2051,12 @@
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
"license": "ISC"
},
+ "node_modules/lucide-static": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/lucide-static/-/lucide-static-1.52.0.tgz",
+ "integrity": "sha512-0zZYihAze4ZmUCcyNa9OkWYqn/Y5f9AdTh02AZIxMtP5ravcTTfoSIAnUPBH6ZvKxt+ZW28JB0ldzLRyD82fcw==",
+ "license": "ISC"
+ },
"node_modules/marked": {
"version": "15.0.12",
"resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz",
@@ -2685,6 +2693,25 @@
"node": ">=8"
}
},
+ "node_modules/simple-icons": {
+ "version": "16.34.0",
+ "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-16.34.0.tgz",
+ "integrity": "sha512-UTxKn0PVspk84B2hHF3Dqiqht1yDjJmDc/t4cO7PyCQxCMk6OjEu95pnpGjhLaGeQ4qBrGASbefTIe/+czrX7g==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/simple-icons"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/simple-icons"
+ }
+ ],
+ "license": "CC0-1.0",
+ "engines": {
+ "node": ">=0.12.18"
+ }
+ },
"node_modules/source-map": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
diff --git a/package.json b/package.json
index b156bad..b8dd0bf 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,8 @@
"hexo-renderer-stylus": "^3.0.1",
"hexo-server": "^3.0.0",
"hexo-theme-landscape": "^1.0.0",
+ "lucide-static": "^1.52.0",
+ "simple-icons": "^16.34.0",
"strip-ansi": "^6.0.1"
}
}
diff --git a/scripts/event_filter.js b/scripts/event_filter.js
index 16eb8c6..ff9face 100644
--- a/scripts/event_filter.js
+++ b/scripts/event_filter.js
@@ -23,12 +23,25 @@ hexo.extend.filter.register('before_generate', function () {
});
hexo.locals.set('nextEvent', futureEvents[0] || false);
- hexo.locals.set('lastEvent', pastEvents[pastEvents.length - 1] || false);
+ // Most recent past event that actually has a video (skips TBD / missing).
+ const pastWithVideo = pastEvents.filter(function (p) {
+ return p.event && p.event.video && p.event.video !== 'TBD';
+ });
+ hexo.locals.set('lastEvent', pastWithVideo[pastWithVideo.length - 1] || false);
// Far-future events (all future except the nearest one) are excluded from
// site.posts so they don't appear in archives or RSS.
const hiddenIds = new Set(futureEvents.slice(1).map(function (p) { return p._id; }));
+ // Every event (including hidden far-future ones) for the /events/ timeline.
+ // `hasPage` is false for hidden events, since no page is generated for them.
+ hexo.locals.set('allEvents', eventPosts.map(function (p) {
+ let state = 'upcoming';
+ if (p.date.valueOf() < today.getTime()) state = 'past';
+ else if (p === futureEvents[0]) state = 'next';
+ return { post: p, state: state, hasPage: !hiddenIds.has(p._id) };
+ }));
+
if (hiddenIds.size > 0) {
const filtered = hexo.locals.get('posts').filter(function (p) {
return !hiddenIds.has(p._id);
diff --git a/scripts/icon.js b/scripts/icon.js
new file mode 100644
index 0000000..1e2cca2
--- /dev/null
+++ b/scripts/icon.js
@@ -0,0 +1,52 @@
+'use strict';
+
+// Inline SVG icons at build time.
+// Templates: <%- icon('si:gitlab') %> / <%- icon('lucide:map-pin') %>
+// Markdown: {% icon lucide:download %}
+// si: Simple Icons (brand logos) https://simpleicons.org
+// lucide: Lucide (general icons) https://lucide.dev
+// custom: themes/openalt/icons/*.svg (logos missing from the above, e.g. LinkedIn)
+
+const fs = require('fs');
+const path = require('path');
+
+const sets = {
+ si: path.join(hexo.base_dir, 'node_modules/simple-icons/icons'),
+ lucide: path.join(hexo.base_dir, 'node_modules/lucide-static/icons'),
+ custom: path.join(hexo.theme_dir, 'icons')
+};
+
+const cache = new Map();
+
+function icon(name) {
+ if (!name) return '';
+ if (cache.has(name)) return cache.get(name);
+
+ const [set, id] = name.split(':');
+ const dir = sets[set];
+ const file = dir && id && path.join(dir, id + '.svg');
+
+ if (!file || !fs.existsSync(file)) {
+ hexo.log.warn('icon: unknown icon "%s"', name);
+ cache.set(name, '');
+ return '';
+ }
+
+ const svg = fs.readFileSync(file, 'utf8')
+ .replace(//g, '')
+ .replace(/
[\s\S]*?<\/title>/, '')
+ .replace(/\s+/g, ' ')
+ .trim()
+ // Drop the root's own sizing/class/role; CSS sizes icons via .icon
+ .replace(/