-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove discord widget and add version checking
- Loading branch information
1 parent
2a82bfc
commit 9b8463a
Showing
2 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block extrahead %} | ||
<script src='https://cdn.jsdelivr.net/npm/@widgetbot/crate@3' async defer> | ||
const button = new Crate({ | ||
server: '822460010649878528', // Funky Penguin | ||
channel: '822460010649878531', // #elf-friends channel | ||
username: 'Kometa Website Visitor', | ||
indicator: true, | ||
color: '#00bc8c', | ||
location: ['bottom', 'left'] | ||
}) | ||
</script> | ||
{% block announce %} | ||
<script> | ||
const currentURL = window.location.href; | ||
|
||
// Base announcement for Discord support | ||
let announceText = 'For any questions and support, please reach out to us on <a href="https://kometa.wiki/en/latest/discord/">Discord</a>'; | ||
|
||
// Check if URL includes nightly or develop | ||
if (currentURL.includes("en/nightly") || currentURL.includes("en/develop")) { | ||
|
||
// Find the branch name ("nightly" or "develop") | ||
let branchName = currentURL.includes("en/nightly") ? "NIGHTLY" : "DEVELOP"; | ||
|
||
// Create a new URL pointing to the "latest" version of the current page | ||
let latestURL = currentURL.replace(/en\/(nightly|develop)\//, 'en/latest/'); | ||
|
||
// Update the announceText to include the custom link and branch name | ||
announceText = `️⚠️ You are viewing the ${branchName} branch's wiki. <bold><a href="${latestURL}">Click here to go to the main wiki.</a></b> ⚠️️`; | ||
} | ||
|
||
document.write(announceText); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters