Skip to content

Commit

Permalink
redo mod page for sdk, grab version from github
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed May 5, 2024
1 parent 4871f5c commit 139f01d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
25 changes: 25 additions & 0 deletions _mods/oak_mod_manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
pyproject_url: https://raw.githubusercontent.com/bl-sdk/oak-mod-manager/master/manager_pyproject.toml
version: Unknown
nav_exclude: true
---
<script>
async function update_version() {
const response = await fetch(
"https://api.github.com/repos/bl-sdk/oak-mod-manager/releases/latest",
{
headers: {
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
},
}
);
const data = await response.json();
if (data.tag_name) {
document.querySelector("#version").innerText = data.tag_name;
}
}
document.extra_custom_updater_promises = [update_version()];
</script>

The SDK itself.
4 changes: 0 additions & 4 deletions _mods/python_sdk.md

This file was deleted.

5 changes: 5 additions & 0 deletions assets/js/pyproject-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ async function load_from_pyproject(url, fields) {
}
}

// Allow mod pages to have custom updaters, which we'll wait on before removing the notification
if (document.extra_custom_updater_promises) {
await Promise.all(document.extra_custom_updater_promises);
}

// Finished updating, hide the notification
document.querySelector("span.update-notification").remove();
}
Expand Down

0 comments on commit 139f01d

Please sign in to comment.