-
Notifications
You must be signed in to change notification settings - Fork 375
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
GitHub Module Shows Out-of-Date Metadata #6
Comments
Here, the repository metadata is not updated immediately. It needs to wait around one day according to me. If you want "asynchronously", it needs to send AJAX call each time a client visit your page. But to say the truth (I used this way before). It takes around 0.5 to 2 seconds and github api is not as stable as you think. It is why I choose github metadata plugin here, almost no delay. I think one-day-delay for numbers of stars is ok for most of cases. For the error you mention, I guess you tried to get some "security" fields like cname. I suggest to visit this page: https://github.com/jekyll/github-metadata. In "Authentication", you will find solution. In my code, I only choose the public fields to avoid using tokens, because I think it's dangerous to keep your token public in your source code ... |
I still do not understand. I do have a CNAME file in my repo. How is that security? Secondly, what are these tokens the "Authentication" section you refer to is discussing? How are they generated? How do environment variables in any of the proposed solutions affect the deployment to GitHub? |
First question: According to the plugin itself, check here: https://github.com/jekyll/github-metadata. Area "For some fields, like cname, you need to authenticate yourself. ". I don't know why, but it seems that some fileds like cname need your token. Second question: Third question: |
Interestingly, I discovered the problem I previously cited #3 is not solved by the latest Ruby. It actually only happens at a specific time of day (0000 - 0400 EDT). When I run
Generates the following error:
It does this every night after midnight, and in the morning, the error just disappears. Removing the GitHub API line removes the error. I tried changing my computer's clock time, to see if the error would go away if the localhost though it was tomorrow morning, but it did not fix anything. I wonder if there is a time window late each night GitHub's API is just down? |
WOW. First time to know it!! I did some research, but no answer. "sort" here means "site.github.public_repositories" is null. So I suggest to check directly msolters.github.io after midnight. If it's ok, just ignore it. Github API may have some special process hidden in the background :( |
If you are still experiencing this issue, I have a blog post and video showing how to fix it. The skinny of it is this:
The blog post assumes you are on a Windows machine, but the same steps should work on a Mac. |
When a site is deployed to GitHub pages, the GitHub module works correctly at first -- it produces a list of open source repositories, with "last modified" dates, number of stars, etc.
However, the repository data does not update on subsequent visits to the site. For example, GitHub's feed notifies me that I have received two more stars on a repo, but on my site it still shows the old number of stars, and the old "last modified" date.
I understand the purpose of Jekyll is that it renders static site content. However, I would have imagined that the GitHub module is asynchronously making GitHub API calls to get the metadata. Otherwise it would be by design constantly out-of-date!
Is there something I am doing wrong? I do get this message when I run
bundle exec jekyll serve
locally:The text was updated successfully, but these errors were encountered: