summaryrefslogtreecommitdiffstats
path: root/_layouts/default.html
diff options
context:
space:
mode:
authorSimone Bortolin <simonebortolin@users.noreply.github.com>2022-12-12 23:08:37 +0100
committerSimone Bortolin <simonebortolin@users.noreply.github.com>2022-12-19 23:09:27 +0100
commit2f1ade9723eaae158731263cebc26ca4b3bb89e0 (patch)
treece2d90ba70573babd8df575920b4f88726bf42c2 /_layouts/default.html
parentReplace the preboot uboot variable to unlock the stick with the correct one from the manufacturer (#43) (diff)
downloadhack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar.gz
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar.bz2
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar.lz
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar.xz
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.tar.zst
hack-gpon.github.io-2f1ade9723eaae158731263cebc26ca4b3bb89e0.zip
Diffstat (limited to '_layouts/default.html')
-rw-r--r--_layouts/default.html16
1 files changed, 11 insertions, 5 deletions
diff --git a/_layouts/default.html b/_layouts/default.html
index fe0aa0a..15482bb 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -270,10 +270,11 @@ layout: table_wrappers
if (document.getElementById('last-modified')) {
listOfScannedFilename.push("{{ page.path }}");
fetch("https://api.github.com/repos/{{ site.gh_owner_name }}/{{ site.gh_repository_name }}/commits?path={{ page.path }}")
- .then((response) => {
- return response.json();
- })
- .then(async function (commits) {
+ .then((response) => {
+ return response.json();
+ })
+ .then(async function (commits) {
+ try{
var date = new Date(commits[0]['commit']['committer']['date']);
var modified = date.toLocaleDateString(undefined);
@@ -283,7 +284,12 @@ layout: table_wrappers
document.getElementById('contributors').textContent = authors.length + " " + (authors.length == 1 ? "Contributor" : "Contributors");
document.getElementById('contributors-modal-list').innerHTML = authors.map(x => "<li><a href='" + x.html_url + "'><img class='avatar' src='" + x.avatar_url + "'><span>" + x.name + "</span<</a></li>").join('');
- });
+ } catch (err) {
+ document.getElementById('last-modified').textContent = "Sorry, last modified not currently available";
+ document.getElementById('contributors').textContent = "Contributors";
+ document.getElementById('contributors-modal-list').innerHTML = "<li>Sorry, list not currently available</li>";
+ }
+ });
}
}