-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
{docsify-updated} cannot show as expected in GitHub pages #1157
Comments
Hi, I have the same problem and I create a repo on gitee. Repo address: https://gitee.com/JingqingLin/docsify-test The first page was updated on 2020/06/02 20:42 and the second page was updated on 2020/06/02 20:45, but all pages was show 2020/06/02 20:45. |
Can you try to run on a server without a CDN? I think this is still a caching problem. @jingqinglin |
I put it on VPS, and the time is right. If I deploy it on GitHub Pages, does |
@jingqinglin You can try it use github pages. vps: |
I put it on GitHub Pages, |
There doesn't seem to be a good solution. 😅 |
I forgot the context of this issue. I will check this soon. |
I did a little search and found this, Last Modified Dates for GitHub Pages Jekyll Posts. Basically, it uses GitHub API Now the problem is how to extract docsify/src/core/fetch/ajax.js Line 61 in 75c72e9
|
Same problem. Any progress? |
I have the same problem. but localhost the time is ok. |
Thank you @yzhang-gh for your comment #1157 (comment) I provide some code for interested users to create a plugin. Take docsify's repository as an example window.$docsify = {
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
date_url = 'https://api.github.com/repos/docsifyjs/docsify/commits?per_page=1&path=' + vm.config.basePath + vm.route.file;
fetch(date_url)
.then((response) => {
return response.json();
})
.then((commits) => {
var modified = commits[0]['commit']['committer']['date'].slice(0, 10);
document.getElementById('last-modified').textContent = "Last Modified: " + modified;
});
return (
html +
'\n\n----\n\n' +
'<span id="last-modified"></span>'
);
});
}
]
}; |
HI ,this is a demo plugin: |
Bug Report
Steps to reproduce
I add this script to index.html so that {docsify-updated} can be shown at the bottom of every pags.
What is current behaviour
It works well at my local computer, that is, the file updated at 04.22.2020 will show 04.22.2020, the file updated at 05.04 will show 05.04. However, when I made another commit while not modify these two files at 05.05.2020,and push the new commit to GitHub, all pages depolyed in GitHub pages show 05.05.2020 at bottom. Local docsify pages still work well and show 04.22 and 05.04.
What is the expected behaviour
{docsify-updated} shows the same behaviour at both the local and github pages environment
Maybe this problem is not created by docsify, because it works at my local computer. Is it true that github modify all the files even my new commit only contains one single file?
The text was updated successfully, but these errors were encountered: