🔍 Sitemap support alias

This commit is contained in:
2024-08-17 22:10:27 +08:00
parent 81a021744c
commit 2169e9c564
2 changed files with 4 additions and 2 deletions

View File

@ -50,9 +50,11 @@ export default defineEventHandler(async (event) => {
.use(rehypeStringify)
.process(post.body.content)
const slug = post.alias ? `/posts/${post.area_alias}:${post.alias}` : `/posts/${post.id}`
feed.addItem({
date: new Date(post.published_at),
link: `https://solsynth.dev/posts/${post.id}`,
link: `https://solsynth.dev/${slug}`,
title: post.body.title ?? `Post #${post.id}`,
description: post.body.description,
content: String(content),