-
Notifications
You must be signed in to change notification settings - Fork 1
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
page modified date tracking #1
Comments
Can't identify a built-in variable which might do this. It might be possible to embed a "now" function onto each page in the hopes that only modified pages get regenerated by the jekyll engine during the publishing process. |
…ate for each page on build.
Looks like there is a jekyll plugin to support this: jekyll-last-modified-at. Github pages only supports building with plugins they have whitelisted. The gem is not in github-pages, so the only way to use it would be to build the site locally and commit it to the repo. I put a request into github pages to see if they will add this plugin to their (rather short) whitelist (github/pages-gem#119). |
Client-side, using var xhReq = new XMLHttpRequest();
xhReq.open("HEAD", "My_File.xlsx", false);
xhReq.send(null);
var lastModified = xhReq.getResponseHeader("Last-Modified"); would work, except the github pages jekyll engine seems to update all the files in the compiled site, even if they were not modified during the commit. |
Perhaps the best method I can find is to make an ajax call to the github API: > $.ajax({url: "https://api.github.com/repos/technickle/open-data-resources/commits?path=/bills/bills.csv", success: function(data){console.log(data[0].commit.author.date)}})
2015-02-12T17:53:27Z The response is actually an array of commit objects, and they don't seem to be in date/time order, but that could be addressed pretty easily in-code. The URL can be parameterized in the frontmatter YML for the relevant page. |
Each page should display the date on which it was last modified. This should be determined automatically, ideally from Jekyll/Liquid variables, and injected into the _layouts/default.html template.
The text was updated successfully, but these errors were encountered: