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) + "...";
|
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() {
|
async function fetchGiteaCommits() {
|
||||||
const allCommits = [];
|
const allCommits = [];
|
||||||
|
|
||||||
@@ -25,6 +31,7 @@ async function fetchGiteaCommits() {
|
|||||||
|
|
||||||
for (const c of Array.isArray(commits) ? commits : []) {
|
for (const c of Array.isArray(commits) ? commits : []) {
|
||||||
const msg = (c.commit?.message || "").split("\n")[0];
|
const msg = (c.commit?.message || "").split("\n")[0];
|
||||||
|
if (isPostManagementCommit(msg)) continue;
|
||||||
allCommits.push({
|
allCommits.push({
|
||||||
sha: c.sha.slice(0, 7),
|
sha: c.sha.slice(0, 7),
|
||||||
message: truncate(msg),
|
message: truncate(msg),
|
||||||
|
|||||||
@@ -108,6 +108,12 @@ const GITEA_URL = '{{ site.gitea.url }}';
|
|||||||
const GITEA_ORG = '{{ site.gitea.org }}';
|
const GITEA_ORG = '{{ site.gitea.org }}';
|
||||||
const GITEA_REPOS = {{ site.gitea.repos | dump | safe }};
|
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) {
|
function categorizeCommit(message) {
|
||||||
const lower = (message || '').toLowerCase();
|
const lower = (message || '').toLowerCase();
|
||||||
if (/^feat(\(.+\))?!?:/.test(lower)) return 'features';
|
if (/^feat(\(.+\))?!?:/.test(lower)) return 'features';
|
||||||
@@ -177,6 +183,7 @@ function changelogApp() {
|
|||||||
for (const c of commits) {
|
for (const c of commits) {
|
||||||
const lines = (c.commit?.message || '').split('\n');
|
const lines = (c.commit?.message || '').split('\n');
|
||||||
const title = lines[0];
|
const title = lines[0];
|
||||||
|
if (isPostManagementCommit(title)) continue;
|
||||||
const body = lines.slice(1).join('\n').trim();
|
const body = lines.slice(1).join('\n').trim();
|
||||||
newCommits.push({
|
newCommits.push({
|
||||||
sha: c.sha.slice(0, 7),
|
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>
|
<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">
|
<p class="text-surface-600 dark:text-surface-400">
|
||||||
My open source contributions and starred repositories.
|
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>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -203,9 +200,10 @@ withSidebar: true
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</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 →
|
View all repositories →
|
||||||
</a>
|
</a>
|
||||||
|
#}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="text-surface-600 dark:text-surface-400">No repositories found.</p>
|
<p class="text-surface-600 dark:text-surface-400">No repositories found.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user