Files
pengzhan.dev/views/pages/home.ejs
T
haopengzhan 8c0b04db0e 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
2026-09-16 23:08:53 -07:00

62 lines
3.0 KiB
Plaintext

<%- include('../partials/head', { pageType: 'home' }) %>
<div class="home-wrapper">
<% if (page && page.contentHtml) { %>
<div class="home-main-content">
<%- page.contentHtml %>
</div>
<% } %>
<% if (recentPosts && recentPosts.length> 0) { %>
<section class="home-recent-posts"
style="margin-top: 5rem; padding-top: 3rem; border-top: 1px solid var(--color-border);">
<div style="display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2rem;">
<h2 style="font-size: 2rem; margin: 0; font-family: var(--font-serif); font-weight: 400;">Recent Posts
</h2>
<a href="/blogs" class="nav-link" style="font-size: 0.95rem; font-weight: 500;">View all blogs &rarr;</a>
</div>
<div class="home-posts-compact-list">
<% recentPosts.forEach(post=> { %>
<a href="/<%= post.slug %>" class="home-post-compact-item">
<% if (post.cover) { %>
<img src="<%= post.cover %>" alt="<%= post.title %>" class="home-post-thumb" loading="lazy">
<% } else { %>
<div class="home-post-thumb-placeholder">
<span>
<%= post.title.slice(0, 1) %>
</span>
</div>
<% } %>
<div class="home-post-compact-body">
<h3 class="home-post-compact-title">
<%= post.title %>
</h3>
<div class="home-post-compact-meta">
<time datetime="<%= post.date.toISOString() %>">
<%= post.date.toLocaleDateString('en-US', { month: 'short' , day: 'numeric' ,
year: 'numeric' }) %>
</time>
<% if (post.category) { %>
<span class="meta-sep">&bull;</span>
<span>
<%= post.category %>
</span>
<% } %>
<% if (post.availableLanguages && post.availableLanguages.length> 1) { %>
<span class="meta-sep">&bull;</span>
<span class="meta-lang-tag">[<%= post.availableLanguages.map(l=>
l.toUpperCase()).join('|') %>]</span>
<% } %>
</div>
<p class="home-post-compact-excerpt">
<%= post.excerpt %>
</p>
</div>
</a>
<% }) %>
</div>
</section>
<% } %>
</div>
<%- include('../partials/foot', { pageType: 'home' }) %>