Skip to content

Commit 6f6502f

Browse files
committed
chore: replace RSS and sitemap generation with simplified scripts
1 parent b450499 commit 6f6502f

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

.github/workflows/deploy.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,41 @@ jobs:
2424
- name: Install dependencies
2525
run: npm install
2626

27-
- name: Generate SEO files (simple version)
27+
- name: Generate SEO files (simple)
2828
run: |
29-
# 간단한 sitemap 생성
30-
cat > public/sitemap.xml << 'EOF'
31-
<?xml version="1.0" encoding="UTF-8"?>
32-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33-
<url>
34-
<loc>https://eottabom.github.io/</loc>
35-
<lastmod>$(date -u +%Y-%m-%dT%H:%M:%S+00:00)</lastmod>
36-
</url>
37-
</urlset>
38-
EOF
29+
mkdir -p public
30+
POSTS=$(find content/posts -type f -name '*.mdx' | sed 's|content/posts/||;s|.mdx||')
3931
40-
# 간단한 RSS 생성
41-
cat > public/rss.xml << 'EOF'
42-
<?xml version="1.0" encoding="UTF-8"?>
43-
<rss version="2.0">
44-
<channel>
45-
<title>eottabom.github.io</title>
46-
<link>https://eottabom.github.io</link>
47-
<description>Blog RSS Feed</description>
48-
<lastBuildDate>$(date -u +"%a, %d %b %Y %H:%M:%S +0000")</lastBuildDate>
49-
</channel>
50-
</rss>
51-
EOF
32+
echo '<?xml version="1.0" encoding="UTF-8"?>' > public/sitemap.xml
33+
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' >> public/sitemap.xml
34+
35+
for POST in $POSTS; do
36+
echo " <url>" >> public/sitemap.xml
37+
echo " <loc>https://eottabom.github.io/post/$POST</loc>" >> public/sitemap.xml
38+
echo " <changefreq>weekly</changefreq>" >> public/sitemap.xml
39+
echo " <priority>0.7</priority>" >> public/sitemap.xml
40+
echo " </url>" >> public/sitemap.xml
41+
done
42+
43+
echo '</urlset>' >> public/sitemap.xml
44+
45+
echo '<?xml version="1.0" encoding="UTF-8"?>' > public/rss.xml
46+
echo '<rss version="2.0"><channel>' >> public/rss.xml
47+
echo '<title>eottabom.github.io</title>' >> public/rss.xml
48+
echo '<link>https://eottabom.github.io</link>' >> public/rss.xml
49+
echo '<description>Blog RSS Feed</description>' >> public/rss.xml
50+
echo "<lastBuildDate>$(date -u +"%a, %d %b %Y %H:%M:%S +0000")</lastBuildDate>" >> public/rss.xml
51+
52+
for POST in $POSTS; do
53+
echo "<item>" >> public/feed.xml
54+
echo "<title>$POST</title>" >> public/feed.xml
55+
echo "<link>https://eottabom.github.io/post/$POST</link>" >> public/rss.xml
56+
echo "<guid>https://eottabom.github.io/post/$POST</guid>" >> public/rss.xml
57+
echo "<pubDate>$(date -u +"%a, %d %b %Y %H:%M:%S +0000")</pubDate>" >> public/rss.xml
58+
echo "</item>" >> public/rss.xml
59+
done
60+
61+
echo '</channel></rss>' >> public/rss.xml
5262
5363
- name: Build and Export
5464
run: |

0 commit comments

Comments
 (0)