从 GitHub 问题生成博客
Generate a blog from GitHub issue.
$ git clone https://github.com/djyde/sairin-starter.git your_blog
$ cd your_blog && rm .git
# install dependencies
$ npm iBefore running, you need to set these environment variable by creating a .env:
REPO: The GitHub repo name. Like user/repoGITHUB_TOKEN: The personal access token# run the blog
$ npm run dev$ npm run exportThe static site will be ouput to /out
siteConfigtitle (required) Your blog titleauthor The author name of your blog. The repo owner login id will be set by defaulturl The URL of your blog. Start with http:// or https://. This field is required if you want to enable RSS.theme (required)themeConfig A config object passed to the themeallowUsers string[] An array of GitHub user login id that allowed to publish blog post. By default, only issues created by the repo owner will be published on the blog.GITHUB_TOKEN (required) Personal Access Token to call GitHub APIREPO The repository which will be fetch blog posts from (e.g owner/repo). By default it will use the repo that created by Vercel.Sairin support RSS out of the box. You need to set url on the sairin.config.ts to enable it:
// sairin.config.ts
export default {
siteConfig: {
title: 'Sairin',
+ url: 'http://your-site.com'
},
} as SairinConfig;The RSS feed is on http://your-site.com/rss.xml.
No.
Blog will be updated every 1 minute.
Sairin supports custom theme. But the API is not stable now. If you still want to try to develope a theme, you could see the source code of the built-in theme sairin-theme-minimal.
Sairin use pnpm to organize the packages, you need to install pnpm first.
Install the dependencies:
$ pnpm iCreate a .env file on example/:
GITHUB_TOKEN= # need to provide a GitHub access token when developing, or it will reach the API request rate limit.
REPO=djyde/sairin # you can change to any repo for debuggingRun dev command:
$ pnpm run dev --filter "*" --parallelThis command will run a blog on localhost.
暂无开放 Issues,或尚未同步最近议题。