feat: initial release of pengzhan.dev personal editorial blog platform

- Editorial web platform built with Node.js, Express, EJS, and Vanilla CSS
- Markdown content engine with YAML frontmatter, bilingual variants, and hot-reload watcher
- Unified SQLite with FTS5 search indexing, query logging, and schema filters
- Centered editorial post layout with margin-docked left TOC and mobile bottom sheet
- WordPress-grade comment system with moderation dashboard and bulk operations under /guanli
- Complete SEO suite (JSON-LD structured data, RSS/Atom feeds, XML sitemap, robots.txt)
- CI/CD workflows for linting, security audits (Gitleaks), automated tests, and Docker releases
This commit is contained in:
2026-09-16 23:08:53 -07:00
parent ac2c4c09ef
commit 8c0b04db0e
126 changed files with 8515 additions and 3984 deletions
@@ -0,0 +1,17 @@
module.exports = {
injectHead({ pluginConfig }) {
const trackingId = pluginConfig.tracking_id;
if (!trackingId) return '';
return `
<!-- Google Analytics (GA4 via Plugin) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=${trackingId}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${trackingId}');
</script>
`;
}
};
@@ -0,0 +1,5 @@
{
"name": "google-analytics",
"version": "1.0.0",
"description": "Injects Google Analytics 4 tracking script into head"
}
@@ -0,0 +1,18 @@
module.exports = {
onPostLoad({ post }) {
const wordCount = (post.rawContent || '').trim().split(/\s+/).length;
// Assume average 200 words per minute
const minutes = Math.max(1, Math.round(wordCount / 200));
post.readingTime = `${minutes} min read`;
post.wordCount = wordCount;
},
injectPostEnd({ post }) {
if (post && post.readingTime) {
return `<div style="font-family: var(--font-sans); font-size: 0.85rem; color: var(--color-text-muted); margin-top: 2rem; padding: 0.75rem 1rem; background: var(--color-surface-soft); border-radius: var(--radius-sm);">
Article statistics: ~${post.wordCount} words &bull; ${post.readingTime}
</div>`;
}
return '';
}
};
@@ -0,0 +1,5 @@
{
"name": "reading-time",
"version": "1.0.0",
"description": "Calculates reading time and word count for articles"
}
@@ -0,0 +1,15 @@
module.exports = {
onPostLoad({ post }) {
const raw = post.rawContent || '';
const internalMatches = raw.match(/\[[^\]]+\]\((\/[^)]+)\)/g) || [];
const externalMatches = raw.match(/\[[^\]]+\]\((https?:\/\/[^)]+)\)/g) || [];
post.seoMetrics = {
internalLinkCount: internalMatches.length,
externalLinkCount: externalMatches.length,
hasMetaDescription: Boolean(post.excerpt && post.excerpt.length > 30),
titleLength: post.title.length,
isTitleOptimal: post.title.length >= 25 && post.title.length <= 70
};
}
};
@@ -0,0 +1,5 @@
{
"name": "seo-analyzer",
"version": "1.0.0",
"description": "Dynamic SEO auditor and content health inspector"
}