Telegram bot for posting new content items to website created by great static site generator Hugo
- Create website with Hugo or clone from here
- For created site copy/edit rule from here. It creates new article from json file inside "data/externalPost/".
- Rename
config-sample.json
toconfig-sample.json
, create tg bot & add token - Build go bin, put it & config.json to the hugo website root
When GO bin runs from the website root, it waits commands from telegram bot.
If used command /add
:
- bot asks article title and description
- creates json file with content
data/externalPost/<title>.json
- runs cli HUGO command for create new website page
hugo new posts/<title>.md
- Hugo has snippet for path
posts/
. Look at folderdata/externalPost/<title>.json
, if exist such file create from it's content the website page