@@ -18,6 +18,8 @@ const path = computed(() => route.fullPath.replace('/', ''))
|
||||
© 2020-2024 No Right is reserved. Who cares 🤷♂️? It's
|
||||
<a href="https://github.com/nurriyad/blog" target="_blank" rel="nofollow" class="underline">open source</a>
|
||||
anyway.
|
||||
|
||||
<a href="/rss.xml"> <span class="px-3"><Icon name="bi:rss-fill" /></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ export default defineNuxtConfig({
|
||||
sitemap: {
|
||||
strictNuxtContentPaths: true,
|
||||
},
|
||||
|
||||
site: {
|
||||
url: seoData.mySite,
|
||||
identity: {
|
||||
@@ -33,6 +34,7 @@ export default defineNuxtConfig({
|
||||
crawlLinks: true,
|
||||
routes: [
|
||||
'/',
|
||||
'/rss.xml',
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -62,4 +64,6 @@ export default defineNuxtConfig({
|
||||
theme: 'dracula',
|
||||
},
|
||||
},
|
||||
|
||||
compatibilityDate: '2024-09-30',
|
||||
})
|
||||
|
||||
9209
package-lock.json
generated
9209
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,10 +13,10 @@
|
||||
"@antfu/eslint-config": "^0.42.0",
|
||||
"@formkit/auto-animate": "^0.8.1",
|
||||
"@nuxt/content": "^2.12.1",
|
||||
"@nuxt/image": "^1.7.0",
|
||||
"@nuxt/image": "^1.8.0",
|
||||
"@nuxtjs/color-mode": "^3.3.2",
|
||||
"@nuxtjs/fontaine": "^0.4.1",
|
||||
"@nuxtjs/robots": "^3.0.0",
|
||||
"@nuxtjs/robots": "^4.1.7",
|
||||
"@nuxtjs/sitemap": "^5.3.2",
|
||||
"@nuxtjs/tailwindcss": "^6.11.4",
|
||||
"@stefanobartoletti/nuxt-social-share": "^0.6.1",
|
||||
@@ -25,7 +25,8 @@
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@vueuse/nuxt": "^10.9.0",
|
||||
"eslint": "^8.39.0",
|
||||
"nuxt": "^3.12.2",
|
||||
"feed": "^4.2.2",
|
||||
"nuxt": "^3.13.2",
|
||||
"nuxt-icon": "^0.6.8",
|
||||
"nuxt-og-image": "^3.0.0-rc.38",
|
||||
"typescript": "^5.3.3",
|
||||
|
||||
37
server/routes/rss.xml.ts
Normal file
37
server/routes/rss.xml.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Feed } from 'feed'
|
||||
import { serverQueryContent } from '#content/server'
|
||||
|
||||
const basePath = 'https://nurriyad.xyz'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
setHeader(event, 'content-type', 'text/xml')
|
||||
const docs = await serverQueryContent(event).sort({ date: -1 }).find()
|
||||
const feed = new Feed({
|
||||
title: 'Riyad\'s personal blog site',
|
||||
description: 'Riyad\'s personal blog site',
|
||||
id: basePath,
|
||||
link: basePath,
|
||||
language: 'en',
|
||||
favicon: `${basePath}/favicon.ico`,
|
||||
copyright: 'MIT',
|
||||
author: {
|
||||
name: 'Al Asad Nur Riyad',
|
||||
email: 'asadnurriyad@gmail.com',
|
||||
link: basePath,
|
||||
},
|
||||
})
|
||||
|
||||
// Add the feed items
|
||||
docs.forEach((doc) => {
|
||||
feed.addItem({
|
||||
title: doc.title || '',
|
||||
id: basePath + doc._path,
|
||||
link: basePath + doc._path,
|
||||
description: doc.description,
|
||||
content: doc.description,
|
||||
date: new Date(doc.date),
|
||||
})
|
||||
})
|
||||
|
||||
return feed.rss2()
|
||||
})
|
||||
Reference in New Issue
Block a user