personal-website/static/js/latest-version.js
Adora Laura Kalb 7f2f3d8700
All checks were successful
ci/woodpecker/push/deploy-rsync Pipeline was successful
add version tags on portfolio page
2024-08-03 18:49:02 +02:00

30 lines
719 B
JavaScript

async function FillLatestForgejoRelease() {
const apiPath = `https://forgejo-proxy.services-prod.lila.network/api/v1/code.lila.network/releases`
var forgejoItems = document.getElementsByClassName('forgejo-version')
const requestOptions = {
method: "GET",
redirect: "follow",
};
[...forgejoItems].forEach(async item => {
var repo = item.getAttribute("data-forgejo-repo");
var queryParam = new URLSearchParams({ namespace: repo }).toString()
var response = await fetch(`${apiPath}?${queryParam}`, requestOptions)
if (response.ok) {
item.textContent = await response.text()
}
});
}
FillLatestForgejoRelease()