aleksandrhovhannisyan.com icon indicating copy to clipboard operation
aleksandrhovhannisyan.com copied to clipboard

Add Comments to a Static Site with Netlify Functions and the GitHub API

Open AleksandrHovhannisyan opened this issue 3 years ago • 7 comments

AleksandrHovhannisyan avatar Oct 20 '21 22:10 AleksandrHovhannisyan

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 avatar Nov 18 '21 18:11 AustenLamacraft

@AustenLamacraft Thanks for letting me know! Fixed.

AleksandrHovhannisyan avatar Nov 18 '21 19:11 AleksandrHovhannisyan

Thanks!

zaggler avatar Feb 22 '22 01:02 zaggler

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 as tags
  • 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 avatar Jul 20 '22 10:07 muratcorlu

@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!

AleksandrHovhannisyan avatar Jul 20 '22 11:07 AleksandrHovhannisyan

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

Ahart4u2 avatar Oct 11 '22 03:10 Ahart4u2

One more typo:

const { data: rateLimitInfo } = await Octokit.rateLimit.get();

Should read: const { data: rateLimitInfo } = await octokitClient.rateLimit.get();

JeffML avatar Oct 24 '22 21:10 JeffML

Oops 😅 Thanks! @JeffML

AleksandrHovhannisyan avatar Oct 24 '22 22:10 AleksandrHovhannisyan