Live data from Hacker News

Readme in Static Site (RISS)

cj.rs

1–8 of 8 posts

Re: Readme in Static Site (RISS)

#4
This is neat. Another option is to just ask GitHub to render your README:

    curl  -H "Accept:application/vnd.github.v3.html"  https://api.github.com/repos/captn3m0/hackertray/readme
If your repo is public, you can do this in the browser as well with a single line of jQuery[0] without any authentication. On my blog, the page itself[1] is just a placeholder for the repo URL, and the layout[2] does the rest. Obviously, this isn't static so all the usual caveats apply (SEO/perf/accessibility).

[0]: https://github.com/captn3m0/captn3m0.github.com/blob/master/...

[1]: https://github.com/captn3m0/captn3m0.github.com/blob/master/...

[2]: https://github.com/captn3m0/captn3m0.github.com/blob/master/...

Re: Readme in Static Site (RISS)

#5
post #4

This is neat. Another option is to just ask GitHub to render your README: curl -H "Accept:application/vnd.github.v3.html" https://api.github.com/repos/captn3m0/hackertray/readme If your repo is public, you can do this in the browser as well with a single line of jQuery[0] without any authentication. On my blog, the page itself[1] is just a placeholder for the repo URL, and the layout[2] does the rest. Obviously, this…

More on what github does with passed "Accept:" media types here:

https://docs.github.com/en/rest/overview/media-types

Re: Readme in Static Site (RISS)

#6
post #4

This is neat. Another option is to just ask GitHub to render your README: curl -H "Accept:application/vnd.github.v3.html" https://api.github.com/repos/captn3m0/hackertray/readme If your repo is public, you can do this in the browser as well with a single line of jQuery[0] without any authentication. On my blog, the page itself[1] is just a placeholder for the repo URL, and the layout[2] does the rest. Obviously, this…

Also for a public repo sticherd[0] (Disclaimer: I am the author) can pull the content from github and inject it onto the page server side. Also not static, but has caching and no need for JS.

Soupault or even Hugo can pull remote content as well.

  [0] https://stitcherd.vhodges.dev/ && https://github.com/vhodges/stitcherd

Re: Readme in Static Site (RISS)

#7
post #6
post #4

This is neat. Another option is to just ask GitHub to render your README: curl -H "Accept:application/vnd.github.v3.html" https://api.github.com/repos/captn3m0/hackertray/readme If your repo is public, you can do this in the browser as well with a single line of jQuery[0] without any authentication. On my blog, the page itself[1] is just a placeholder for the repo URL, and the layout[2] does the rest. Obviously, this…

Also for a public repo sticherd[0] (Disclaimer: I am the author) can pull the content from github and inject it onto the page server side. Also not static, but has caching and no need for JS. Soupault or even Hugo can pull remote content as well. [0] https://stitcherd.vhodges.dev/ && https://github.com/vhodges/stitcherd

That's an interesting project, I'll add it to the readme of Riss.

Re: Readme in Static Site (RISS)

#8
post #7
post #6

Earlier quoted context omitted.

Also for a public repo sticherd[0] (Disclaimer: I am the author) can pull the content from github and inject it onto the page server side. Also not static, but has caching and no need for JS. Soupault or even Hugo can pull remote content as well. [0] https://stitcherd.vhodges.dev/ && https://github.com/vhodges/stitcherd

That's an interesting project, I'll add it to the readme of Riss.

Thanks! I haven't had much time to work on it lately but I have a use for it at $DAYJOB so hopefully I can get back to it at some point.