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
+394
View File
@@ -0,0 +1,394 @@
:root {
--color-bg: #f9f9f9;
--color-surface: #ffffff;
--color-surface-soft: #f4f4f5;
--color-text-main: #111111;
--color-text-secondary: #4b5563;
--color-text-muted: #6b7280;
--color-border: #e5e7eb;
--color-border-hover: #d1d5db;
--color-accent: #111111;
--color-mark-bg: #fef08a;
--color-mark-text: #111111;
--font-serif: 'Cardo', 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'STSong', Georgia, serif;
--font-mono: 'Maple Mono NF CN', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--max-width: 1180px;
--content-width: 820px;
--header-height: 80px;
--radius-sm: 6px;
--radius-md: 12px;
--radius-lg: 20px;
--radius-full: 9999px;
--transition-fast: 0.15s ease;
--transition-normal: 0.25s ease;
}
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
scroll-behavior: smooth;
-webkit-text-size-adjust: 100%;
}
body {
font-family: var(--font-serif);
color: var(--color-text-main);
background-color: var(--color-bg);
line-height: 1.8;
letter-spacing: 0.01em;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
width: 100%;
max-width: var(--max-width);
margin: 0 auto;
padding: 0 2rem;
}
.content-container {
width: 100%;
max-width: var(--content-width);
margin: 0 auto;
}
/* Header */
.site-header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(249, 249, 249, 0.95);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
height: var(--header-height);
display: flex;
align-items: center;
}
.header-inner {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.brand {
text-decoration: none;
color: var(--color-text-main);
}
.brand-title {
font-size: 1.55rem;
font-family: var(--font-serif);
font-weight: 700;
letter-spacing: -0.01em;
}
.site-nav {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
text-decoration: none;
font-family: var(--font-serif);
font-size: 1.05rem;
color: var(--color-text-main);
transition: opacity var(--transition-fast);
padding: 0.25rem 0;
}
.nav-link:hover {
opacity: 0.65;
}
.nav-link.active {
text-decoration: underline;
text-underline-offset: 4px;
}
/* Mobile Hamburger Menu Toggle */
.mobile-menu-toggle {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
flex-direction: column;
justify-content: center;
gap: 5px;
width: 40px;
height: 40px;
}
.hamburger-line {
display: block;
width: 22px;
height: 2px;
background-color: var(--color-text-main);
border-radius: 2px;
transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
opacity: 0;
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
transform: translateY(-7px) rotate(-45deg);
}
/* Mobile Slide-Down Navigation Drawer */
.mobile-nav-drawer {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: var(--color-bg);
border-bottom: 1px solid var(--color-border);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
padding: 0.75rem 1.25rem 1.25rem;
z-index: 999;
}
.mobile-nav-drawer.is-open {
display: block;
animation: slideDown 0.25s ease;
}
@keyframes slideDown {
from { opacity: 0; transform: translateY(-8px); }
to { opacity: 1; transform: translateY(0); }
}
.mobile-nav-links {
display: flex;
flex-direction: column;
}
.mobile-nav-link {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.85rem 0.5rem;
text-decoration: none;
color: var(--color-text-main);
font-family: var(--font-serif);
font-size: 1.15rem;
border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.05));
transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.mobile-nav-link:last-child {
border-bottom: none;
}
.mobile-nav-link:hover, .mobile-nav-link:active {
color: var(--color-accent);
padding-left: 0.75rem;
}
.mobile-nav-link.active {
font-weight: 600;
color: var(--color-accent);
}
.mobile-nav-arrow {
font-size: 1rem;
opacity: 0.4;
}
/* Main Content area */
.site-main {
flex: 1;
padding: 2.5rem 0 4rem;
}
/* Footer */
.site-footer {
border-top: 1px solid var(--color-border);
background-color: var(--color-surface);
padding: 2.5rem 0;
font-family: var(--font-sans);
font-size: 0.88rem;
color: var(--color-text-muted);
}
.footer-inner {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1.5rem;
}
.social-links {
display: flex;
gap: 1.25rem;
align-items: center;
}
.social-link {
color: var(--color-text-secondary);
display: flex;
align-items: center;
justify-content: center;
transition: color var(--transition-fast), transform var(--transition-fast);
}
.social-link:hover {
color: var(--color-text-main);
transform: translateY(-2px);
}
.social-link svg {
width: 19px;
height: 19px;
fill: currentColor;
}
/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
color: var(--color-text-main);
line-height: 1.35;
margin-bottom: 1rem;
font-weight: 700;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.65rem; margin-top: 2rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; }
p {
margin-bottom: 1.25rem;
}
a {
color: var(--color-accent);
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 3px;
transition: color var(--transition-fast);
}
a:hover {
color: #000000;
}
mark {
background-color: var(--color-mark-bg);
color: var(--color-mark-text);
padding: 0.1em 0.25em;
border-radius: 3px;
font-weight: 500;
}
blockquote {
border-left: 3px solid var(--color-border-hover);
padding: 0.5rem 0 0.5rem 1.25rem;
margin: 1.5rem 0;
color: var(--color-text-secondary);
font-style: italic;
}
hr {
border: 0;
height: 1px;
background: var(--color-border);
margin: 2.5rem 0;
}
/* Responsive */
@media (max-width: 768px) {
:root {
--header-height: 64px;
--content-padding: 1.25rem;
}
.site-header {
position: sticky;
top: 0;
z-index: 990;
}
/* Hide inline desktop nav and show hamburger */
.site-nav.desktop-nav {
display: none;
}
.mobile-menu-toggle {
display: flex;
}
.brand-title {
font-size: 1.25rem;
}
.brand-tagline {
font-size: 0.68rem;
display: block;
margin-top: 0.1rem;
opacity: 0.85;
}
/* Centered, balanced editorial mobile footer */
.site-footer {
padding: 2.5rem 1.25rem 3rem;
}
.footer-inner {
flex-direction: column;
align-items: center;
text-align: center;
gap: 1.4rem;
}
.footer-left {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.45rem;
}
.footer-tagline {
font-family: var(--font-serif);
font-size: 1.05rem;
color: var(--color-text-main);
}
.footer-copyright {
font-size: 0.82rem;
color: var(--color-text-muted);
}
.social-links {
justify-content: center;
gap: 1.5rem;
}
.social-link {
display: flex;
align-items: center;
justify-content: center;
min-width: 44px;
min-height: 44px;
}
}
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
/* Fonts definitions with graceful local fallbacks */
@font-face {
font-family: 'XiaoheSimplifySerif-VF';
src: url('/fonts/XiaoheSimplifySerif-VF.otf') format('opentype');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Maple Mono NF CN';
src: url('/fonts/MapleMono-NF-CN-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Maple Mono NF CN';
src: url('/fonts/MapleMono-NF-CN-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
font-display: swap;
}
+118
View File
@@ -0,0 +1,118 @@
/**
* Okaidia PrismJS theme matching WordPress Prismatic plugin
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: 'Maple Mono NF CN', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 0.95em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.6;
tab-size: 2;
hyphens: none;
}
pre[class*="language-"] {
padding: 1.25rem 1.5rem;
margin: 1.75rem 0;
overflow: auto;
border-radius: 12px;
background: #272822;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
/* Inline code outside pre */
:not(pre) > code {
padding: 0.2em 0.4em;
border-radius: 4px;
color: #e83e8c;
background-color: rgba(0, 0, 0, 0.05);
font-family: 'Maple Mono NF CN', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.88em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #8292a2;
}
.token.punctuation {
color: #f8f8f2;
}
.token.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}