aleksandrhovhannisyan.com
aleksandrhovhannisyan.com copied to clipboard
Add Comments to a Static Site with Netlify Functions and the GitHub API
Thanks for this great tutorial! I'm just beginning to work through it. One typo I just came across is that in Testing Netlify Functions Locally the flag should be --querystring
not --queryString
i.e. no camel case.
@AustenLamacraft Thanks for letting me know! Fixed.
Thanks!
Is there a reason not to use GitHub issues (first entry) also as the source of the article itself? I see some good benefits of doing that:
- Issue will be more consumable since the article will be on top
- Writing articles even would be easier compared to pushing a markdown file (especially while being mobile)
- We have issue
labels
to use astags
- Only issues that has
post
label can be published. So other type of issues will not published as blog post - This way a single blog can have multiple authors easily. Just add
post
label to an issue from someone else and it'll be published as blog post. And we have author information already with the API. - There are many good trigger events for GitHub actions. With a good incremental build, every new issue can build blog very quickly.
Some potential issues that I see:
- Embedded images. Normally github hosts images that you pasted to an issue. That can be even easier if you prefer. Otherwise you need to manually put images somewhere.
- Using template shortcuts could be a problem. Need to try.
- Putting some extra type of frontier data would be an issue.
I want to give it a try but wanted to mention here first to get early insights about this idea.
@muratcorlu It's certainly an interesting idea. One reason I might not do this is because it ties you down to that one repo, whereas imo your articles should be independent media that you can transfer between different CMSes/source control platforms as needed. Another reason is that authoring posts in GitHub issues limits your ability to add custom styling, JavaScript, semantics, and other design elements. For example, you can't use shortcodes (e.g., 11ty) or MDX (Next/Gatsby).
If it works for you, though, go for it!
Enjoyed the information in the article. Also the article on Twitter was so true. It will take over and you have to take a break from all social media.
Thank you
One more typo:
const { data: rateLimitInfo } = await Octokit.rateLimit.get();
Should read: const { data: rateLimitInfo } = await octokitClient.rateLimit.get();
Oops 😅 Thanks! @JeffML