From 8dc202bbc9896fe3290ebcd56ac02c5879355b61 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Thu, 2 Apr 2026 09:10:20 +0200 Subject: [PATCH] fix: dont show PostManagementCommits --- _data/githubActivity.js | 7 +++++++ changelog.njk | 7 +++++++ github.njk | 6 ++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/_data/githubActivity.js b/_data/githubActivity.js index 50d0fa5..49d6036 100644 --- a/_data/githubActivity.js +++ b/_data/githubActivity.js @@ -14,6 +14,12 @@ function truncate(text, maxLength = 80) { return text.slice(0, maxLength - 1) + "..."; } +const POST_MANAGEMENT_RE = /^(create|update|delete)\s+\w+\s+post$/i; + +function isPostManagementCommit(msg) { + return POST_MANAGEMENT_RE.test((msg || "").trim()); +} + async function fetchGiteaCommits() { const allCommits = []; @@ -25,6 +31,7 @@ async function fetchGiteaCommits() { for (const c of Array.isArray(commits) ? commits : []) { const msg = (c.commit?.message || "").split("\n")[0]; + if (isPostManagementCommit(msg)) continue; allCommits.push({ sha: c.sha.slice(0, 7), message: truncate(msg), diff --git a/changelog.njk b/changelog.njk index 1a2cc96..c912f57 100644 --- a/changelog.njk +++ b/changelog.njk @@ -108,6 +108,12 @@ const GITEA_URL = '{{ site.gitea.url }}'; const GITEA_ORG = '{{ site.gitea.org }}'; const GITEA_REPOS = {{ site.gitea.repos | dump | safe }}; +const POST_MANAGEMENT_RE = /^(create|update|delete)\s+\w+\s+post$/i; + +function isPostManagementCommit(msg) { + return POST_MANAGEMENT_RE.test((msg || '').trim()); +} + function categorizeCommit(message) { const lower = (message || '').toLowerCase(); if (/^feat(\(.+\))?!?:/.test(lower)) return 'features'; @@ -177,6 +183,7 @@ function changelogApp() { for (const c of commits) { const lines = (c.commit?.message || '').split('\n'); const title = lines[0]; + if (isPostManagementCommit(title)) continue; const body = lines.slice(1).join('\n').trim(); newCommits.push({ sha: c.sha.slice(0, 7), diff --git a/github.njk b/github.njk index 43fac06..4b722c0 100644 --- a/github.njk +++ b/github.njk @@ -9,9 +9,6 @@ withSidebar: true
My open source contributions and starred repositories. - - Follow me on GitHub -
@@ -203,9 +200,10 @@ withSidebar: true {% endfor %} - +{# View all repositories → +#} {% else %}No repositories found.
{% endif %}