feat: add admin publishing workflow and yar theme

Add Go/Postgres admin APIs, Angular admin UI, manual build flow, asset uploads, markdown import/export, configurable slug generation, and the Yar reading theme. Exclude local docs and generated development artifacts from version control.
This commit is contained in:
yarnom 2026-06-01 15:48:04 +08:00
parent b78f4b39c9
commit f0b50d13ea
121 changed files with 27139 additions and 550 deletions

View file

@ -1,10 +1,15 @@
---
import '../styles/global.css';
import SiteNav from '../components/SiteNav.astro';
import '../styles/normalize.css';
import DefaultHome from '../components/DefaultHome.astro';
import YarHome from '../components/themes/yar/YarHome.astro';
import { site } from '../lib/siteConfig';
import { getPublishedPosts, tagSlug } from '../lib/posts';
import { getPaginatedPosts, getPublishedPosts, getTotalPages } from '../lib/posts';
const posts = getPublishedPosts();
const allPosts = getPublishedPosts();
const posts = getPaginatedPosts(allPosts, 1);
const totalPages = getTotalPages(allPosts);
const theme = site.theme?.trim().toLowerCase() ?? 'default';
const Home = theme === 'yar' ? YarHome : DefaultHome;
---
<!doctype html>
@ -16,44 +21,6 @@ const posts = getPublishedPosts();
<meta name="description" content={site.description} />
</head>
<body>
<main class="page">
<SiteNav />
<header class="site-header">
<p class="eyebrow">{site.description}</p>
<h1>{site.title}</h1>
</header>
<section class="post-list" aria-label="Posts">
{posts.length === 0 ? (
<p class="empty">No published posts yet.</p>
) : (
posts.map((post) => (
<article class="post-item">
<a href={post.url}>
<h2>{post.title}</h2>
{post.summary && <p>{post.summary}</p>}
<div class="post-meta">
{post.date && (
<time datetime={post.date}>
{new Date(post.date).toLocaleDateString(site.language)}
</time>
)}
{post.tags.length > 0 && (
<ul class="tags" aria-label="Tags">
{post.tags.map((tag) => (
<li>
<a href={`/tags/${tagSlug(tag)}/`}>{tag}</a>
</li>
))}
</ul>
)}
</div>
</a>
</article>
))
)}
</section>
</main>
<Home posts={posts} currentPage={1} totalPages={totalPages} />
</body>
</html>