An open API service indexing awesome lists of open source software.

https://github.com/kemingy/isite

convert issues to a website
https://github.com/kemingy/isite

blog-generator github-issues ssg zola

Last synced: about 2 months ago
JSON representation

convert issues to a website

Awesome Lists containing this project

README

          

# isite

[![Go](https://github.com/kemingy/isite/actions/workflows/go.yml/badge.svg)](https://github.com/kemingy/isite/actions/workflows/go.yml)

Convert GitHub **i**ssues to a web**site**.

## Examples

- https://github.com/kemingy/withcode ➡️ https://kemingy.github.io/withcode/
- https://github.com/yihong0618/gitblog ➡️ https://blog.yihong0618.me/

## Usage

```bash
isite generate --help
```

After generating the Markdown based documents, you can build the website with the following engines.

## Engines

- [x] [zola](https://github.com/getzola/zola)
- default theme: [Even](https://github.com/kemingy/even), modified to support comments and reactions
- [ ] [hugo](https://github.com/gohugoio/hugo)

## Installation

- GitHub Releases: download the pre-built binaries from the [releases](https://github.com/kemingy/isite/releases) page.
- Docker Image: [`docker pull ghcr.io/kemingy/isite`](https://github.com/kemingy/isite/pkgs/container/isite)

## GitHub Actions

> [!IMPORTANT]
> Please remember to enable the GitHub Pages with GitHub Actions as the source.

You can audit and apply the following GitHub Actions workflow to deploy the static content generated by `isite` to GitHub Pages.

```yaml
name: Deploy static content to Pages

on:
issues:
types:
- opened
- edited
- closed
- reopened
- labeled
- unlabeled
issue_comment:
types:
- created
- edited
- deleted
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
# bump the versions here
ISITE_VERSION: v0.2.2
ZOLA_VERSION: v0.20.0
USER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
# change this to your custom domain name
BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate markdown
run: |
gh release download $ISITE_VERSION --repo kemingy/isite -p '*Linux_x86_64*' -O- | tar -xz -C /tmp && mv /tmp/isite /usr/local/bin
isite generate --user $USER --repo $REPO
gh release download $ZOLA_VERSION --repo getzola/zola -p '*x86_64-unknown-linux*' -O- | tar -xz -C /tmp && mv /tmp/zola /usr/local/bin
cd output && zola build --base-url $BASE_URL
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'output/public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
```

## Customization

### Domain name

Change the `BASE_URL` in the GitHub Actions workflow to your custom domain name.

### Other themes

```bash
isite generate --theme --theme-repo
```

### Backup Markdown files to the Repo

```yaml
- name: backup markdown files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "github-actions@users.noreply.github.com"
git checkout -b backup
git add output/content
git commit -m "Backup markdown files"
git push --force origin backup
```