mirror of
https://github.com/He4eT/oddsquat.git
synced 2026-05-04 20:37:22 +00:00
rss: use reqire again
This commit is contained in:
parent
6a36004011
commit
789453f068
2 changed files with 6 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
export const feed = [[
|
const feed = [[
|
||||||
'2021-10-02',
|
'2021-10-02',
|
||||||
'https://oddsquat.org/1',
|
'https://oddsquat.org/1',
|
||||||
'Second Item Title',
|
'Second Item Title',
|
||||||
|
|
@ -9,3 +9,5 @@ export const feed = [[
|
||||||
'First Item Title',
|
'First Item Title',
|
||||||
'Use this for the content. It can include html.'
|
'Use this for the content. It can include html.'
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
module.exports = { feed }
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import rss from 'rss-generator'
|
const rss = require('rss-generator')
|
||||||
import { feed } from './rss-entries.js'
|
const { feed } = require('./rss-entries.js')
|
||||||
|
const { writeFile } = require('fs')
|
||||||
|
|
||||||
const url = 'https://oddsquat.org'
|
const url = 'https://oddsquat.org'
|
||||||
const rssFeed = new rss({
|
const rssFeed = new rss({
|
||||||
|
|
@ -13,7 +14,6 @@ const rssFeed = new rss({
|
||||||
feed.forEach(([date, url, title, description]) =>
|
feed.forEach(([date, url, title, description]) =>
|
||||||
rssFeed.item({date, url, title, description}))
|
rssFeed.item({date, url, title, description}))
|
||||||
|
|
||||||
import { writeFile } from 'fs'
|
|
||||||
const RSS_FILEPATH =
|
const RSS_FILEPATH =
|
||||||
'./src/assets/rss.xml'
|
'./src/assets/rss.xml'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue