fix: extensive ui improvements
This commit is contained in:
parent
691394445a
commit
6ba64d29a9
17 changed files with 684 additions and 142 deletions
47
src/lib/site.ts
Normal file
47
src/lib/site.ts
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
const CLEARNET_HOST = "jetpham.com";
|
||||
const ONION_HOST =
|
||||
"jet7tetd43snvjx3ng5jrhuwm2yhyp76tjtct5mtofg64apokcgq7fqd.onion";
|
||||
const COMMIT_BASE_URL = "https://git.extremist.software/jet/website/commit/";
|
||||
const REPO_URL = "https://git.extremist.software/jet/website";
|
||||
|
||||
function isOnionHost(hostname: string): boolean {
|
||||
return hostname.endsWith(".onion");
|
||||
}
|
||||
|
||||
function getMirrorLink() {
|
||||
if (isOnionHost(location.hostname)) {
|
||||
return {
|
||||
href: `https://${CLEARNET_HOST}`,
|
||||
label: "clearnet",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
href: `http://${ONION_HOST}`,
|
||||
label: ".onion",
|
||||
};
|
||||
}
|
||||
|
||||
export function renderFooter() {
|
||||
const footer = document.getElementById("site-footer");
|
||||
if (!footer) return;
|
||||
|
||||
const commitSha = __COMMIT_SHA__;
|
||||
const shortSha = commitSha.slice(0, 7);
|
||||
const mirror = getMirrorLink();
|
||||
|
||||
footer.innerHTML = `
|
||||
<div class="site-panel px-[2ch] py-[1ch]">
|
||||
<div class="site-footer-inner">
|
||||
<span>rev <a href="${COMMIT_BASE_URL}${commitSha}">${shortSha}</a></span>
|
||||
<span aria-hidden="true">|</span>
|
||||
<a href="${REPO_URL}">src</a>
|
||||
<span aria-hidden="true">|</span>
|
||||
<a href="/pgp.txt" data-native-link>pgp</a>
|
||||
<span aria-hidden="true">|</span>
|
||||
<a href="/ssh.txt" data-native-link>ssh</a>
|
||||
<span aria-hidden="true">|</span>
|
||||
<a href="${mirror.href}">${mirror.label}</a>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue