Skip to content

Commit

Permalink
sitemap 및 baseurl수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkBeomMin committed Dec 27, 2023
1 parent cad03b9 commit 6ffd0e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
app: {
baseURL: "/BeomLog/",
baseURL: "/",
}, //
devtools: { enabled: true },
modules: [
Expand Down
32 changes: 16 additions & 16 deletions server/routes/sitemap.xml.ts
Original file line number Diff line number Diff line change
@@ -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);
});

0 comments on commit 6ffd0e2

Please sign in to comment.