Skip to content

ysl4/gh-discussions-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# For macOS arm.
curl -o deno.zip https://ghfast.top/https://github.com/denoland/deno/releases/download/v1.25.0/deno-aarch64-apple-darwin.zip
# For macOS x86.
curl -o deno.zip https://ghfast.top/https://github.com/denoland/deno/releases/download/v1.25.0/deno-x86_64-apple-darwin.zip
# For windows x86.
curl -o deno.zip https://ghfast.top/https://github.com/denoland/deno/releases/download/v1.25.0/deno-x86_64-pc-windows-msvc.zip
# For Linux x86.
curl -o deno.zip https://ghfast.top/https://github.com/denoland/deno/releases/download/v1.25.0/deno-x86_64-unknown-linux-gnu.zip

unzip deno.zip

mv deno ~/.vocal
chmod 777 ~/.vocal/deno


echo 'GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' > .env

Intro

Export Discussions in a repo as .md files. Also generate an index of posts as well as feed (rss or json).

Usage (Workflow)

  1. "Use this template" to create a repo for discussions Or create a workflow like this in an existing repo
  2. Edit or overwrite script/config.js as needed
  3. The workflow will run automatically when a discussion is created or edited

Usage (Local)

  1. Install deno (developed on 1.25)
  2. Set environment variable GITHUB_TOKEN in command line or in .env file in project directory
  3. Edit script/config.js as needed
  4. deno run --allow-net --allow-env --allow-read --allow-write scripts/fetchPosts.js

Background

Some projects (e.g. YeungKC/Hakuba) use Github Discussions as a Content Management System for blogs. (In fact, Github Discussions works very well as a blog by itself.) Basically, the workflows of those projects are

  1. Export discussions to .md files
  2. Use static site generator to build .html pages

This project only does 1. Then the files can be used for any SSG or just as backup. The generated feed can be used by a feed reader (demo link).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •