在Profile Readme中添加近期博客自动拉取功能

为增强github仓库和个人博客的联动,所以想要在Profile Readme中加入最近发布的博客链接,并作展示



1. 配置博客订阅(以RSS或ATOM格式输出)

注:如果博客自带RSS支持可以跳过 >详见博主的另一篇文章:为particlex主题提供RSS支持

2. 在个人主仓库中添加workflow(.github/workflows/xxx.yml)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
name: Latest blog post workflow
on:
schedule:
- cron: "0 * * * *"
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gautamkrishnar/blog-post-workflow@master
with:
max_post_count: "5" # 获取的链接数量
feed_list: "" # 博客订阅地址(RSS格式/Atom格式)

我的rss地址是https://ethanh3514.github.io/atom.xml

3. 在Profile Readme中要引用的位置标示

添加如下代码

1
2
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->


img_show