diff --git a/README.md b/README.md index 5aff317..4ae857c 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ TODO # How do I build this? This project uses material mkdocs. -To install materal mkdocs, simply run: +To install materal mkdocs (and it's dependencies), simply run: pip install mkdocs-material - + pip install mkdocs-exclude-search + Then run `mkdocs serve` to preview it. You can also build it into static html files using `mkdocs build`. \ No newline at end of file diff --git a/docs/assets/Download.js b/docs/assets/Download.js new file mode 100644 index 0000000..e409c8b --- /dev/null +++ b/docs/assets/Download.js @@ -0,0 +1,27 @@ +let dlText = document.getElementById("download-text"); +let descText = document.getElementById("description-text"); + +const hash = window.location.hash.substr(1); + +if (!hash || hash === "" || hash.length !== 64) redirect404(); + +fetch("/api/getFile?id=" + hash).then(function(response) { + return response.json(); + }).then(function(data) {setupPage(data)}); + +function setupPage(data) { + if (data["Error"]) redirect404(); + + dlText.innerText = `Download '${data["Name"]}'`; + descText.innerText = data["Description"]; +} + + +function redirect404() { + window.location.replace("/404"); + throw new Error("404"); +} + +function downloadFile() { + window.location.href = "/api/dlFile?id=" + hash; +} \ No newline at end of file diff --git a/docs/assets/download-24.png b/docs/assets/download-24.png new file mode 100644 index 0000000..428104d Binary files /dev/null and b/docs/assets/download-24.png differ diff --git a/docs/hidden/Download.md b/docs/hidden/Download.md new file mode 100644 index 0000000..24ff8f4 --- /dev/null +++ b/docs/hidden/Download.md @@ -0,0 +1,20 @@ +# Download Text + +##### File Description: +
Description Text
+ +