djyde / sairin

Generate a blog from GitHub Issue
https://blog.sairinjs.com
199 stars 11 forks source link

showcase

Sairin

Generate a blog from GitHub issue.

One Click Deploy

Deploy with Vercel

Get started

  1. Clone the starter template
$ git clone https://github.com/djyde/sairin-starter.git your_blog

$ cd your_blog && rm .git

# install dependencies

$ npm i
  1. Run the blog

Before running, you need to set these environment variable by creating a .env:

# run the blog

$ npm run dev
  1. Export the blog as a static site
$ npm run export

The static site will be ouput to /out

Documentation

sairin.config.ts

Environment Variables

RSS Support

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.

FAQ

Need I redeploy the Vercel project after the issue updated?

No.

How long will take to update the latest content after the issue content update?

Blog will be updated every 1 minute.

Theme Development

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.

Build

Development

Sairin use pnpm to organize the packages, you need to install pnpm first.

Install the dependencies:

$ pnpm i

Create 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 debugging

Run dev command:

$ pnpm run dev --filter "*" --parallel

This command will run a blog on localhost.