Create blogs in Github Pages using Discord.
- The
worker.py
is able to run a Discord bot which will have commands that you can use to update your blog in Github Pages. - The program derives an html page from
base.html
and replaces placeholders fordate
,title
andcontent
to what you give it on discord. - I originally came up with this to work on my own blog and it hasn't been bad.
- The bot provides minimal functionality as it was made as a personal project. I will polish it depending on the attention it gets or you're more than welcome to open a PR.
- clone this repo:
git clone https://github.com/aswinnnn/blog-my-mind.git
- The bot relies on
discord.py
(stable version) so make sure you got that. - edit config.json
{"github-username": "the x in your x.github.io",
"discord-bot-token": "your discord bot token"}
- place the files in your
x.github.io
repo folder. - run
python worker.py
- requires Python
9
or above, tested on Python10.4
.
- Do
,help
in the discord chat after runningworker.py
and making sure the bot is in the server.
There are 4 basic commands:
date
: example:,date 9 August 2022
or anything really, its astr
.title
: example:,title My Perfect Blog
content
: example:,content This will be the content of your blog article. You are allowed to use html stylings in here such as <i> this </i> or <u> that </u>.
post
: Lets you see the blog before uploading it.upload
: Uploads the blog.
- If you change the folder name from
blog
it will stop working until you change it in the code too. - Don't forget to edit
base.html
andindex.html
according to your liking. - the blog doesn't update
index.html
, you'll have to do it yourself. - You can change the
base.html
but leave the placeholders alone, unless you update it inworker.py
.