-
Notifications
You must be signed in to change notification settings - Fork 282
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
Wrong date used for last commit date #26
Comments
I'm working on modifying the generate-github.js script now. One issue I'm running into is that if the branch is not set explicitly in the theme's YAML front matter then "master" is assumed as the default, but master is not always present in the repo (example) which then results in a 404 when making the call to the github API branches endpoint for getting the last commit date for the branch. This can be dealt with in a couple of ways:
It is easy enough to go with option 2, but that would assume the default branch is the correct one to use, which seems like it might be reasonable though there is something to be said for having the branch set explicitly to the correct one in the front matter. What do you think? |
I think number 2 seems like the correct approach. I imagine most themes default_branch property is still set to master right? |
Yes, for the most part the default_branch is master, however there were around 56 repos that did not have a master branch. I didn't go through them all but the handful I manually examined seemed to forgo the "master" branch in favor of a "gh-pages" branch as the default branch. I'll continue making the modifications incorporating option 2 from above. |
A quick update on this issue. I'm running into a few problems with this because throughout some of the templates there are checks for For instance, in index.html there is this...
...and for a repo like github.com/Phlow/feeling-responsive where there is no master branch in the above $repo never gets set because the wrong $repoName is being constructed when the branch is defaulted to "master" since no github_branch is set in that theme's front matter. The scrub script that you mentioned in your comment on issue #12 might be the key to solving this. In addition to the"stale" property that is to be added, if the github_branch is updated as well with the correct branch from data/themes.json (which as part of this change is now retrieved and set from the github api using the default_branch property of the repo) then the problem will resolve itself. I believe the scrub script would need to be changed in how it's driving the processing—right now the main loop is being driven by the files present in the content/theme directory, but I think it will need to be driven by the keys in the object present in the data/themes.json file. The reason being the branch name is part of the themeKey that gets built and there's no way to reconstruct it properly from the front matter alone (since for themes without a branch name specified it cannot be defaulted to master). I can take a crack at the scrub script but wanted to check with you first for, 1) your thoughts on the above and 2) to ensure you're not also working on the scrub script. |
Yes the scrub script can almost be completey re-written, it was not ready at all. I am not working on it. Your right the scrub script needs its main loop to run off We still need to support people optionally declaring their branch name in the front-matter. |
This was reported in a previous issue (#12) and was decided it was best to open a separate issue for it. Below are the original reported details:
JugglerX responded to the above via comment in the previous issue:
The text was updated successfully, but these errors were encountered: