Show your SpigotMC plugin in HTML
Plugin Details uses an API called Spiget made by Inventivetalent to retrieve a plugins details in JSON form.
Plugin Details has two built in ways to get your details, a simple and a slightly more complicated way.
Note: pid
is the plugins ID.
pid = searchParams.toString().replace("=", "");
This just uses the ? extention at the end of your URL to get the corrisponding SpigotMC resource.
Example: https://example.com/details.html/12345 Spigot: https://spigotmc.org/resources/12345
if (searchParams.has("plugin-name") === true) {
pid = 12345;
}
else {
window.location.href = "assets/invalid.html";
}
If someone uses ?plugin-name, it will use the id 12345. Using words in your URL is much easier to use and remember for later on.
If you need more help, come talk to me in Discord https://discord.gg/tFhTcQ6yMn