fix: dont show PostManagementCommits
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m26s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m26s
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -9,9 +9,6 @@ withSidebar: true
|
||||
<h1 class="text-2xl sm:text-3xl font-bold text-surface-900 dark:text-surface-100 mb-2">GitHub Activity</h1>
|
||||
<p class="text-surface-600 dark:text-surface-400">
|
||||
My open source contributions and starred repositories.
|
||||
<a href="https://github.com/{{ site.feeds.github }}" class="text-emerald-600 dark:text-emerald-400 hover:underline" target="_blank" rel="noopener">
|
||||
Follow me on GitHub
|
||||
</a>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
@@ -203,9 +200,10 @@ withSidebar: true
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<a href="https://github.com/{{ site.feeds.github }}?tab=repositories" class="inline-block mt-4 text-emerald-600 dark:text-emerald-400 hover:underline">
|
||||
{# <a href="https://github.com/{{ site.feeds.github }}?tab=repositories" class="inline-block mt-4 text-emerald-600 dark:text-emerald-400 hover:underline">
|
||||
View all repositories →
|
||||
</a>
|
||||
#}
|
||||
{% else %}
|
||||
<p class="text-surface-600 dark:text-surface-400">No repositories found.</p>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user