diff --git a/next-sitemap.js b/next-sitemap.js deleted file mode 100644 index 1df90c7..0000000 --- a/next-sitemap.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - siteUrl: "https://ncrmro.com", - generateRobotsTxt: true, // (optional) -}; diff --git a/package-lock.json b/package-lock.json index 31841fa..c21e4f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,6 @@ "eslint": "8.49.0", "eslint-config-next": "13.5.2", "kysely-codegen": "^0.10.1", - "next-sitemap": "^1.3.22", "prettier": "^2.4.1" }, "engines": { @@ -1798,12 +1797,6 @@ "node": ">=6.9.0" } }, - "node_modules/@corex/deepmerge": { - "version": "2.6.148", - "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-2.6.148.tgz", - "integrity": "sha512-6QMz0/2h5C3ua51iAnXMPWFbb1QOU1UvSM4bKBw5mzdT+WtLgjbETBBIQZ+Sh9WvEcGwlAt/DEdRpIC3XlDBMA==", - "dev": true - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -8750,25 +8743,6 @@ "next": ">=9.0.0" } }, - "node_modules/next-sitemap": { - "version": "1.9.12", - "resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-1.9.12.tgz", - "integrity": "sha512-kHXf4ZNAGLJyK16HbjzE5X9JlKwXtxW+9J4dh3oT7LSbU/+3bN+VqWjNw/776Otbanf7EJsvl51oQ78qQW5XBQ==", - "dev": true, - "dependencies": { - "@corex/deepmerge": "^2.6.148", - "minimist": "^1.2.5" - }, - "bin": { - "next-sitemap": "bin/next-sitemap" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "next": "*" - } - }, "node_modules/next/node_modules/postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", diff --git a/package.json b/package.json index b7d4f14..ef21b27 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "eslint": "8.49.0", "eslint-config-next": "13.5.2", "kysely-codegen": "^0.10.1", - "next-sitemap": "^1.3.22", "prettier": "^2.4.1" }, "prettier": { diff --git a/src/app/sitemap.xml/route.ts b/src/app/sitemap.xml/route.ts index cf1c4e3..1c0dd3d 100644 --- a/src/app/sitemap.xml/route.ts +++ b/src/app/sitemap.xml/route.ts @@ -1,24 +1,43 @@ import { NextResponse } from "next/server"; -import { db } from "@/lib/database"; +import { db, sql } from "@/lib/database"; export async function GET(request: Request) { const rootURL = "https://ncrmro.com"; const posts = await db .selectFrom("posts") - .select(["slug"]) + .select([ + "slug", + "updated_at", + // sql`date(updated_at, 'unixepoch', 'utc')`.as("updated_at"), + ]) .where("published", "=", 1) .orderBy("publish_date", "desc") .execute(); - console.log(posts); const content = ` ${rootURL} + + ${rootURL}/about + + + ${rootURL}/resume + + + ${rootURL}/posts/tech + + + ${rootURL}/posts/travel + + + ${rootURL}/posts/food + ${posts .map( (p) => ` ${rootURL}/posts/${p.slug} + ${p.updated_at.split(" ")[0]} ` ) .join("\n")}