From 6ffd0e2fe7f6a17d4d40a48121d9d9b25ef434e0 Mon Sep 17 00:00:00 2001 From: bmpark Date: Wed, 27 Dec 2023 15:25:56 +0900 Subject: [PATCH] =?UTF-8?q?sitemap=20=EB=B0=8F=20baseurl=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.ts | 2 +- server/routes/sitemap.xml.ts | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 1f1c22f..744e44a 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,7 +1,7 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ app: { - baseURL: "/BeomLog/", + baseURL: "/", }, // devtools: { enabled: true }, modules: [ diff --git a/server/routes/sitemap.xml.ts b/server/routes/sitemap.xml.ts index ef9a19a..da1d050 100644 --- a/server/routes/sitemap.xml.ts +++ b/server/routes/sitemap.xml.ts @@ -1,21 +1,21 @@ -import { serverQueryContent } from '#content/server'; -import { SitemapStream, streamToPromise } from 'sitemap'; +import { serverQueryContent } from "#content/server"; +import { SitemapStream, streamToPromise } from "sitemap"; export default defineEventHandler(async (event) => { - // Fetch all documents - const docs = await serverQueryContent(event).find(); - const sitemap = new SitemapStream({ - hostname: 'https://blog.beommin.kro.kr', - }); + // Fetch all documents + const docs = await serverQueryContent(event).find(); + const sitemap = new SitemapStream({ + hostname: "https://parkbeommin.github.io/", + }); - for (const doc of docs) { - sitemap.write({ - url: doc._path, - changefreq: 'monthly', - lastmod: doc.date ?? new Date(), - }); - } - sitemap.end(); + for (const doc of docs) { + sitemap.write({ + url: doc._path, + changefreq: "monthly", + lastmod: doc.date ?? new Date(), + }); + } + sitemap.end(); - return streamToPromise(sitemap); + return streamToPromise(sitemap); });