You've already forked zblade.dev
feat(blog): add blog section and rss feed
- Add blog content collection schema and welcome post - Create blog index, post layout components, and dynamic routing - Add `@astrojs/rss` dependency and implement RSS feed generation - Add blog links to header and footer navigation - Update changelog with Gemini 3.1 Pro enhancement notes
This commit is contained in:
Generated
+5681
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.6",
|
||||
"@astrojs/rss": "^4.0.15",
|
||||
"astro": "^5.17.3",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Welcome to the Zaguán Blade Blog"
|
||||
description: "Announcing our new blog where we'll share updates, tutorials, and insights about AI-powered development."
|
||||
pubDate: 2026-02-22
|
||||
tags: ["announcement"]
|
||||
categories: ["General"]
|
||||
draft: true
|
||||
---
|
||||
|
||||
# Welcome to the Zaguán Blade Blog
|
||||
|
||||
This is a placeholder post. Replace me with your actual blog content!
|
||||
|
||||
## What's Coming
|
||||
|
||||
- Release announcements and changelogs
|
||||
- Tutorials and how-to guides
|
||||
- Tips and tricks for getting the most out of Zaguán Blade
|
||||
- Insights into AI-powered development
|
||||
|
||||
Stay tuned for more!
|
||||
@@ -0,0 +1,17 @@
|
||||
import { defineCollection, z } from 'astro:content';
|
||||
|
||||
const blog = defineCollection({
|
||||
type: 'content',
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
pubDate: z.coerce.date(),
|
||||
updatedDate: z.coerce.date().optional(),
|
||||
heroImage: z.string().optional(),
|
||||
tags: z.array(z.string()).default([]),
|
||||
categories: z.array(z.string()).default([]),
|
||||
draft: z.boolean().default(false),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { blog };
|
||||
@@ -59,6 +59,7 @@ const { title, description = "AI-Native code editor built with Rust and Tauri. F
|
||||
<nav class="nav">
|
||||
<a href="/#features">Features</a>
|
||||
<a href="/docs">Docs</a>
|
||||
<a href="/blog">Blog</a>
|
||||
<a href="/changelog">Changelog</a>
|
||||
<a href="/#download">Download</a>
|
||||
<a href="https://zaguanai.com/pricing" target="_blank" rel="noopener">Pricing</a>
|
||||
@@ -80,6 +81,7 @@ const { title, description = "AI-Native code editor built with Rust and Tauri. F
|
||||
<h4>Product</h4>
|
||||
<a href="/#features">Features</a>
|
||||
<a href="/docs">Documentation</a>
|
||||
<a href="/blog">Blog</a>
|
||||
<a href="/changelog">Changelog</a>
|
||||
<a href="/#download">Download</a>
|
||||
<a href="https://zaguanai.com/pricing" target="_blank" rel="noopener">Pricing</a>
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
---
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import BaseLayout from './BaseLayout.astro';
|
||||
|
||||
interface Props {
|
||||
post: CollectionEntry<'blog'>;
|
||||
}
|
||||
|
||||
const { post } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={post.data.title} description={post.data.description}>
|
||||
<main>
|
||||
<article class="blog-post">
|
||||
{post.data.heroImage && (
|
||||
<div class="hero-image">
|
||||
<img src={post.data.heroImage} alt="" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div class="post-container">
|
||||
<header class="post-header">
|
||||
<div class="post-meta">
|
||||
<time datetime={post.data.pubDate.toISOString()}>
|
||||
{post.data.pubDate.toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
})}
|
||||
</time>
|
||||
{post.data.categories.length > 0 && (
|
||||
<span class="categories">
|
||||
{post.data.categories.join(', ')}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<h1 class="post-title">{post.data.title}</h1>
|
||||
<p class="post-description">{post.data.description}</p>
|
||||
{post.data.tags.length > 0 && (
|
||||
<div class="tags">
|
||||
{post.data.tags.map((tag) => <span class="tag">#{tag}</span>)}
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
|
||||
<div class="post-content">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
</BaseLayout>
|
||||
|
||||
<style>
|
||||
.blog-post {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.hero-image {
|
||||
width: 100%;
|
||||
max-height: 400px;
|
||||
overflow: hidden;
|
||||
margin-bottom: var(--space-xl);
|
||||
}
|
||||
|
||||
.hero-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.post-container {
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--space-md);
|
||||
padding-bottom: var(--space-2xl);
|
||||
}
|
||||
|
||||
.post-header {
|
||||
margin-bottom: var(--space-xl);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: var(--space-md);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-text-secondary);
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.categories {
|
||||
color: var(--color-accent);
|
||||
}
|
||||
|
||||
.post-title {
|
||||
font-size: clamp(2rem, 5vw, 3rem);
|
||||
font-weight: 900;
|
||||
line-height: 1.1;
|
||||
margin-bottom: var(--space-md);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.post-description {
|
||||
font-size: 1.125rem;
|
||||
color: var(--color-text-secondary);
|
||||
line-height: 1.6;
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: var(--space-sm);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-accent);
|
||||
background: var(--color-bg-elevated);
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.post-content {
|
||||
font-size: 1.0625rem;
|
||||
line-height: 1.75;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.post-content :global(h2) {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
margin-top: var(--space-xl);
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.post-content :global(h3) {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
margin-top: var(--space-lg);
|
||||
margin-bottom: var(--space-sm);
|
||||
}
|
||||
|
||||
.post-content :global(p) {
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.post-content :global(a) {
|
||||
color: var(--color-accent);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.post-content :global(code) {
|
||||
font-family: var(--font-mono);
|
||||
background: var(--color-bg-elevated);
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.post-content :global(pre) {
|
||||
background: var(--color-bg-elevated);
|
||||
padding: var(--space-md);
|
||||
border-radius: var(--radius-md);
|
||||
overflow-x: auto;
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.post-content :global(pre code) {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.post-content :global(ul),
|
||||
.post-content :global(ol) {
|
||||
margin-bottom: var(--space-md);
|
||||
padding-left: var(--space-lg);
|
||||
}
|
||||
|
||||
.post-content :global(li) {
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
|
||||
.post-content :global(blockquote) {
|
||||
border-left: 3px solid var(--color-accent);
|
||||
padding-left: var(--space-md);
|
||||
margin: var(--space-md) 0;
|
||||
color: var(--color-text-secondary);
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,222 @@
|
||||
---
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
const posts = (await getCollection('blog', ({ data }) => {
|
||||
return import.meta.env.PROD ? data.draft !== true : true;
|
||||
})).sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||
---
|
||||
|
||||
<BaseLayout title="Blog - Zaguán Blade" description="Latest news, tutorials, and insights from Zaguán Blade.">
|
||||
<main>
|
||||
<!-- Hero Section -->
|
||||
<section class="blog-hero">
|
||||
<div class="container">
|
||||
<div class="hero-content">
|
||||
<div class="hero-label">// BLOG</div>
|
||||
<h1 class="hero-title">
|
||||
<span class="title-line-1">BLOG</span>
|
||||
<span class="title-accent">LATEST_NEWS_</span>
|
||||
</h1>
|
||||
<p class="hero-description">
|
||||
News, tutorials, and insights about AI-powered development with Zaguán Blade.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Blog Posts -->
|
||||
<section class="blog-section">
|
||||
<div class="container">
|
||||
<div class="posts-grid">
|
||||
{posts.map((post) => (
|
||||
<a href={`/blog/${post.slug}`} class="post-card">
|
||||
{post.data.heroImage && (
|
||||
<div class="post-image">
|
||||
<img src={post.data.heroImage} alt="" />
|
||||
</div>
|
||||
)}
|
||||
<div class="post-content">
|
||||
<div class="post-meta">
|
||||
<time datetime={post.data.pubDate.toISOString()}>
|
||||
{post.data.pubDate.toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})}
|
||||
</time>
|
||||
</div>
|
||||
<h2 class="post-title">{post.data.title}</h2>
|
||||
<p class="post-excerpt">{post.data.description}</p>
|
||||
{post.data.tags.length > 0 && (
|
||||
<div class="post-tags">
|
||||
{post.data.tags.slice(0, 3).map((tag) => (
|
||||
<span class="tag">#{tag}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</BaseLayout>
|
||||
|
||||
<style>
|
||||
/* Hero */
|
||||
.blog-hero {
|
||||
min-height: 35vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: calc(var(--space-2xl) + 60px);
|
||||
padding-bottom: var(--space-lg);
|
||||
background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.blog-hero .hero-content {
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.hero-label {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-accent);
|
||||
letter-spacing: 0.1em;
|
||||
margin-bottom: var(--space-sm);
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
margin-bottom: var(--space-md);
|
||||
}
|
||||
|
||||
.title-line-1 {
|
||||
display: block;
|
||||
font-size: clamp(2rem, 6vw, 3.5rem);
|
||||
font-weight: 900;
|
||||
line-height: 0.95;
|
||||
letter-spacing: -0.03em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.title-accent {
|
||||
display: block;
|
||||
font-size: clamp(1rem, 2.5vw, 1.25rem);
|
||||
font-weight: 700;
|
||||
color: var(--color-accent);
|
||||
font-family: var(--font-mono);
|
||||
margin-top: 0.25rem;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.hero-description {
|
||||
font-size: 1rem;
|
||||
color: var(--color-text-secondary);
|
||||
line-height: 1.6;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
/* Blog Section */
|
||||
.blog-section {
|
||||
padding: var(--space-xl) 0;
|
||||
}
|
||||
|
||||
/* Posts Grid */
|
||||
.posts-grid {
|
||||
display: grid;
|
||||
gap: var(--space-lg);
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
}
|
||||
|
||||
/* Post Card */
|
||||
.post-card {
|
||||
background: var(--color-bg);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: border-color 0.2s ease, transform 0.2s ease;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.post-card:hover {
|
||||
border-color: var(--color-accent);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.post-image {
|
||||
aspect-ratio: 16/9;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.post-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.post-card:hover .post-image img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.post-content {
|
||||
padding: var(--space-md);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-text-secondary);
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
|
||||
.post-title {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
margin-bottom: var(--space-sm);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.post-excerpt {
|
||||
font-size: 0.9rem;
|
||||
color: var(--color-text-secondary);
|
||||
line-height: 1.5;
|
||||
margin-bottom: var(--space-md);
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
display: flex;
|
||||
gap: var(--space-xs);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.7rem;
|
||||
color: var(--color-accent);
|
||||
background: var(--color-bg-elevated);
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.blog-hero {
|
||||
min-height: auto;
|
||||
padding-top: calc(var(--space-2xl) + 60px);
|
||||
}
|
||||
|
||||
.posts-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
import BlogPost from '../../layouts/BlogPost.astro';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.slug },
|
||||
props: post,
|
||||
}));
|
||||
}
|
||||
|
||||
const post = Astro.props;
|
||||
const { Content } = await post.render();
|
||||
---
|
||||
|
||||
<BlogPost post={post}>
|
||||
<Content />
|
||||
</BlogPost>
|
||||
@@ -41,6 +41,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
Enhancements
|
||||
</h3>
|
||||
<ul class="changes-list">
|
||||
<li><strong>Google Gemini 3.1 Pro.</strong> Trying to make Google Gemini 3.1. Pro work better based on feedback and other OSS projects.</li>
|
||||
<li><strong>Google Gemini.</strong> Updated our Google Gemini implementation in Zaguán Coder Daemon.</li>
|
||||
<li><strong>MiniMax.</strong> Updated our MiniMax implementation for Fireworks in Zaguán Coder Daemon.</li>
|
||||
</ul>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { APIContext } from 'astro';
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
const posts = await getCollection('blog', ({ data }) => {
|
||||
return import.meta.env.PROD ? data.draft !== true : true;
|
||||
});
|
||||
|
||||
return rss({
|
||||
title: 'Zaguán Blade Blog',
|
||||
description: 'Latest news, tutorials, and insights about AI-powered development with Zaguán Blade.',
|
||||
site: context.site ?? 'https://zblade.dev',
|
||||
items: posts.map((post) => ({
|
||||
title: post.data.title,
|
||||
pubDate: post.data.pubDate,
|
||||
description: post.data.description,
|
||||
link: `/blog/${post.slug}/`,
|
||||
})),
|
||||
customData: `<language>en-us</language>`,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user