Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll Github Pages (github.io) #54

Open
synap5e opened this issue Dec 19, 2021 · 1 comment
Open

Jekyll Github Pages (github.io) #54

synap5e opened this issue Dec 19, 2021 · 1 comment

Comments

@synap5e
Copy link

synap5e commented Dec 19, 2021

It's common for people to use Github pages as a free host for their blogs.
Often this is done with Jekyll, which means a common pattern can be identified.

Given a jekyll blog <username>.github.io the posts can be queried by the API
https://api.github.com/repos/<username>/<username>.github.io/contents/posts
(max 1000 files)
Each file will have a path which we can create the page url by concatenating to the original blog with the extension changed from .md to .html
https://<username>.github.io/<path | changesuffix('.html')>

If we need to get creation/modification date the API
https://api.github.com/repos/phra/phra.github.io/commits?path=posts/zwc-fingerprint.md&page=1&per_page=1 (with bigger page size and choosing last for getting creation date).

This would support custom-domain blogs too, provided the user can find the original.
Perhaps doing a redirect check on the final url to support custom domains better would be desirable.

@stefansundin
Copy link
Owner

Hey. Sorry, I completely missed this when you filed it.

One thing that is possible, but it requires cooperation from the author, is to publish an RSS feed like this: https://github.com/stefansundin/privatkopiera/blob/gh-pages/feed.xml

You can see the result here:

Another option that may be ok is to subscribe to the commits from GitHub, e.g. https://github.com/phra/phra.github.io/commits.atom

If the blog isn't on the default branch (e.g. gh-pages) then use https://github.com/stefansundin/privatkopiera/commits/gh-pages.atom

So that's one potential workaround.

I am not sure if I want to implement this idea, but I'll think about it. Thanks for filing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants