Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dasfmi/nuxt-feed
a nuxtjs 3 layer to create RSS feed endpoint
https://github.com/dasfmi/nuxt-feed
feed layer nuxt nuxt3 rss
Last synced: 7 days ago
JSON representation
a nuxtjs 3 layer to create RSS feed endpoint
- Host: GitHub
- URL: https://github.com/dasfmi/nuxt-feed
- Owner: dasfmi
- Created: 2023-02-09T08:14:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T08:16:59.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T11:40:50.786Z (about 1 month ago)
- Topics: feed, layer, nuxt, nuxt3, rss
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nuxt Feed Generator
`nuxt-feed` is a layer that is added on top of Nuxt 3 to generate a `feed.xml` file for your content.
## Installation
Make sure to install the npm package using npm or yarn
```bash
yarn add nuxt-feed
```Then add the dependency to your `extends` in `nuxt.config`:
```ts
defineNuxtConfig({
extends: [
'nuxt-feed'
]
})
```Now, its time to provide the required configuration for the feed
under the `runtimeConfig` key in `nuxt.config`:```ts
defineNuxtConfig({
extends: [
'nuxt-feed'
],
runtimeConfig: {
public: {
feed: {
id: 'rss', // optional, default: 'rss'
title: 'Your site title',
siteUrl: process.env.NUXT_PUBLIC_SITE_URL || 'https://site.com',
description: 'welcome to my cool site',
image: '' // optional,
favicon '' // optional,
language: 'ar-EG', // prefer more explicit language codes like `en-AU` over `en`
author: { // optional
name: 'Islam Shehata',
email: '[email protected]'
},
where: {} // where object for the serverQueryContent() method. default { published: true }
sort: {} // sort object for the serverQueryContent() method. default: { date: -1 }
pathStartsWith: null // optional filter to filter out docs by path before generating the feed, e.g: '/blog'
}
}
}
})```
you are done! you should be able to access your feed at `http://localhost:3000/feed.xml`
in production build, this will be prerendered.