Files
pengzhan.dev/views/pages/blogs.ejs
T
haopengzhan f52b3fe9e4 feat(migration): complete WordPress migration and UX refinements
- Migrate historical posts, localized assets, and 103 comments
- Colocate media into posts/<slug>/images/ and remove wp-content
- Add native bilingual support for ai-can-change post (English default, /zh variant)
- Support clean taxonomy routing (/category/:category and /tag/:tag)
- Dynamically populate categories and tags in sitemap.xml
- Fix header scroll padding/margin offsets for anchor and reference links
- Constrain image and media widths to prevent content overflow
- Redesign homepage recent posts to 4 compact editorial cards
- Restore valid binary favicon.ico and high-res icon assets
- Remove placeholder content and sample test comments
2026-09-16 23:09:09 -07:00

63 lines
2.5 KiB
Plaintext

<%- include('../partials/head', { pageType: 'blogs' }) %>
<div class="blogs-container">
<div class="blogs-header" style="margin-bottom: 2.5rem;">
<h1 style="font-size: 2.8rem; margin-bottom: 0.5rem; font-family: var(--font-serif);">
<%= activeFilter ? (activeFilter.type === 'category' ? `${activeFilter.value} Posts` : `Posts tagged #${activeFilter.value}`) : 'Blogs' %>
</h1>
<% if (activeFilter) { %>
<div style="margin-top: 1rem; display: flex; align-items: center; gap: 0.75rem;">
<span style="font-family: var(--font-sans); font-size: 0.9rem; color: var(--color-text-muted);">
Filtering by <%= activeFilter.type %>:
</span>
<span class="pill" style="background: var(--color-text-main); color: white;">
<%= activeFilter.value %>
</span>
<a href="/blogs" class="pill" style="color: var(--color-text-muted); font-size: 0.8rem;">
&times; Clear filter
</a>
</div>
<% } %>
</div>
<% if (posts && posts.length > 0) { %>
<div class="posts-grid-original">
<% posts.forEach(post => { %>
<%- include('../partials/post-card', { post }) %>
<% }) %>
</div>
<% if (totalPages > 1) {
const filterBaseUrl = activeFilter
? (activeFilter.type === 'category' ? `/category/${encodeURIComponent(activeFilter.value)}` : `/tag/${encodeURIComponent(activeFilter.value)}`)
: '/blogs';
%>
<nav class="pagination-editorial" aria-label="Blog pagination">
<% if (currentPage > 1) { %>
<a href="<%= filterBaseUrl %>?page=<%= currentPage - 1 %>" class="editorial-nav-link">
&larr; Previous Page
</a>
<% } %>
<span style="font-family: var(--font-sans); font-size: 0.9rem; color: var(--color-text-muted);">
Page <%= currentPage %> of <%= totalPages %>
</span>
<% if (currentPage < totalPages) { %>
<a href="<%= filterBaseUrl %>?page=<%= currentPage + 1 %>" class="editorial-nav-link">
Next Page &rarr;
</a>
<% } %>
</nav>
<% } %>
<% } else { %>
<div style="text-align: center; padding: 4rem 1rem;">
<p style="font-size: 1.15rem; color: var(--color-text-muted);">No blog posts found matching your criteria.</p>
<a href="/blogs" class="btn btn-primary" style="margin-top: 1rem; text-decoration: none;">View All Posts</a>
</div>
<% } %>
</div>
<%- include('../partials/foot', { pageType: 'blogs' }) %>