在 root 目录下创建 links.md:

md
---
title: RSS 订阅信息
layout: links
feeds:
  - url: https://blog.rxliuli.com/atom.xml
    avatar: https://blog.rxliuli.com/favicon.ico
  - url: https://manateelazycat.github.io/feed.xml
    avatar: https://manateelazycat.github.io/favicon.ico
feedsUrl: "/links.json"
---
  1. feedsUrl 为 feeds 的 json 数据的 url,如果不设置则默认为 /links.json
  2. feeds 为 rss 订阅的地址,可以是任意的 rss 订阅地址,也可以是 atom 订阅地址。
  3. 使用 github action 自动更新订阅信息, bang feed 命令会读取 links.md 中的 feeds 信息,并将其转换为 json 格式,然后写入到 public/links.json 中。
  4. cron: "0 0 * * *" 每天凌晨更新一次, 你也可以改成每个小时更新一次。
yaml
name: GenFeed

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
  push:
    branches:
      - main
    paths:
      - "links.md"

env:
  token: ${{ secrets.TOKEN }}
  repo: fzdwx.github.io

jobs:
  update-issues:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v4
        with:
          go-version: 1.20.2
      - run: cd /tmp && git clone https://github.com/fzdwx/vitepress-blog-theme
      - run: cd /tmp/vitepress-blog-theme && go install .
      - run: cd /tmp && rm -rf vitepress-blog-theme
      - uses: actions/checkout@v3
      - run: bang version
      - run: bang feed
      - run: git config --global user.name "github.action"
      - run: git config --global user.email "action@github.com"
      - run: git add public/links.json
      - run: git commit -a -m "update"
      - run: git push