mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-08 15:10:37 +00:00
feature: 配置文件整理
This commit is contained in:
30
lib/rss.js
30
lib/rss.js
@@ -4,25 +4,25 @@ import BLOG from '@/blog.config'
|
||||
export function generateRss (posts) {
|
||||
const year = new Date().getFullYear()
|
||||
const feed = new Feed({
|
||||
title: BLOG.title,
|
||||
description: BLOG.description,
|
||||
id: `${BLOG.link}/${BLOG.path}`,
|
||||
link: `${BLOG.link}/${BLOG.path}`,
|
||||
language: BLOG.lang,
|
||||
favicon: `${BLOG.link}/favicon.png`,
|
||||
copyright: `All rights reserved ${year}, ${BLOG.author}`,
|
||||
author: {
|
||||
name: BLOG.author,
|
||||
email: BLOG.email,
|
||||
link: BLOG.link
|
||||
TITLE: BLOG.TITLE,
|
||||
DESCRIPTION: BLOG.DESCRIPTION,
|
||||
id: `${BLOG.LINK}/${BLOG.PATH}`,
|
||||
LINK: `${BLOG.LINK}/${BLOG.PATH}`,
|
||||
language: BLOG.LANG,
|
||||
favicon: `${BLOG.LINK}/favicon.png`,
|
||||
copyright: `All rights reserved ${year}, ${BLOG.AUTHOR}`,
|
||||
AUTHOR: {
|
||||
name: BLOG.AUTHOR,
|
||||
email: BLOG.CONTACT_EMAIL,
|
||||
link: BLOG.LINK
|
||||
}
|
||||
})
|
||||
posts.forEach(post => {
|
||||
feed.addItem({
|
||||
title: post.title,
|
||||
id: `${BLOG.link}/article/${post.slug}`,
|
||||
link: `${BLOG.link}/article/${post.slug}`,
|
||||
description: post.summary,
|
||||
TITLE: post.title,
|
||||
id: `${BLOG.LINK}/article/${post.slug}`,
|
||||
LINK: `${BLOG.LINK}/article/${post.slug}`,
|
||||
DESCRIPTION: post.summary,
|
||||
date: new Date(post?.date?.start_date || post.createdTime)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user