---
import { Code } from '@astrojs/starlight/components';
// Fetches the latest commit hash from Forgejo at build time
let version = "latest";
try {
const response = await fetch("https://forgejo.perny.dev/api/v1/repos/perny/hudkit/commits?limit=1");
if (response.ok) {
const commits = await response.json();
if (commits && commits.length > 0) {
version = commits[0].sha.substring(0, 7);
}
}
} catch (e) {
console.error("Failed to fetch version:", e);
}
const gradleCode = `repositories {
maven {
url = uri("https://repo.hudkit.net/releases")
}
}
dependencies {
implementation("net.hudkit:api:${version}")
}`;
const mavenRepoCode = `
Add the Hudkit API to your build.gradle.kts:
Add the Hudkit repository to your pom.xml:
Then add the dependency: