-
Notifications
You must be signed in to change notification settings - Fork 7
/
rss.sh
35 lines (30 loc) · 968 Bytes
/
rss.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
feed="feed.xml"
website_title="德莱问 • 前端热文"
website_link="http://www.dravenwu.top"
description="德莱问 • 前端热文,每日更新,优质文章"
newest_files='docs/menu.md'
echo $newest_files
link="http://www.dravenwu.top/menu.html"
now=`date +"%Y-%m-%d"`
items="
<item>
<title><![CDATA[前端热文 • 列表]]></title>
<link>$link</link>
<guid isPermaLink=\"false\">$link</guid>
<pubDate>$now</pubDate>
<description><![CDATA[$now 文章更新]]></description>
</item>
"
rss_content="<?xml version=\"1.0\" encoding=\"utf-8\"?><rss xmlns:atom=\"http://www.w3.org/2005/Atom\" version=\"2.0\">
<channel>
<title>$website_title</title>
<atom:link href=\"$website_link/$feed\" rel=\"self\" type=\"application/rss+xml\" />
<link>$website_link</link>
<description>$description</description>
$items
</channel>
</rss>"
echo "$rss_content" > "docs/.vuepress/public/$feed"
echo ""
echo "✨ RSS Done!"