We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d36843 commit 2460f66Copy full SHA for 2460f66
index.html
@@ -140,10 +140,8 @@
140
const seconds = String(date.getSeconds()).padStart(2, '0');
141
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
142
}
143
- const file = vm.route.file
144
- const lastIndex = file.lastIndexOf("/");
145
- const filePath = vm.route.path === '/' ? '/README.md' : file.substring(0, lastIndex);
146
- const apiUrl = `https://api.github.com/repos/${$docsify.repo}/commits?path=${filePath}`;
+ const { file } = vm.route
+ const apiUrl = `https://api.github.com/repos/${$docsify.repo}/commits?path=${file}`;
147
fetch(apiUrl, { method: 'GET' }).then(response => response.json())
148
.then(data => {
149
const date = data[0].commit.committer.date
0 commit comments