Add external download path support

This commit is contained in:
2026-07-24 23:43:36 +02:00
parent 6341a8fde5
commit afa8db8eff
4 changed files with 45 additions and 6 deletions
+15 -1
View File
@@ -31,16 +31,29 @@
NO MID NO FEED NO MID NO FEED
</p> </p>
<?php if (empty($options[$os_guess]["download_path"])): ?>
<a class="recommended build disabled">
<div>
Download unavailable
</div>
</a>
<?php else: ?>
<a class="recommended build" href="<?= $options[$os_guess]["download_path"] ?>" download="<?= $options[$os_guess]["download_filename"] ?>"> <a class="recommended build" href="<?= $options[$os_guess]["download_path"] ?>" download="<?= $options[$os_guess]["download_filename"] ?>">
<div> <div>
Download for <?= $options[$os_guess]["name"] ?> Download for <?= $options[$os_guess]["name"] ?>
</div> </div>
</a> </a>
<?php endif; ?>
<?php if ($display_other_builds): ?>
<ul class="other-builds"> <ul class="other-builds">
<p>Other builds</p> <p>Other builds</p>
<?php foreach($options as $os => $target): ?> <?php foreach($options as $os => $target): ?>
<?php
if (empty($target["download_path"])) {
continue;
}
?>
<li> <li>
<a class="other build" href="<?= $target["download_path"] ?>" download="<?= $target["download_filename"] ?>"> <a class="other build" href="<?= $target["download_path"] ?>" download="<?= $target["download_filename"] ?>">
<?= $target["name"] ?><span class="architecture"><?= $target["architecture"] ?></span> <?= $target["name"] ?><span class="architecture"><?= $target["architecture"] ?></span>
@@ -48,6 +61,7 @@
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?>
</main> </main>
<footer> <footer>
<p>In case of any questions, message <a href="<?= $contact_link ?>"><?= $contact_name ?></a>.</p> <p>In case of any questions, message <a href="<?= $contact_link ?>"><?= $contact_name ?></a>.</p>
+2 -2
View File
@@ -4,13 +4,13 @@ $options = [
"linux" => [ "linux" => [
"name" => "Linux", "name" => "Linux",
"architecture" => "x86-64", "architecture" => "x86-64",
"download_path" => "releases/supercardinality", "download_path" => "",
"download_filename" => "supercardinality", "download_filename" => "supercardinality",
], ],
"windows" => [ "windows" => [
"name" => "Windows", "name" => "Windows",
"architecture" => "x86-64", "architecture" => "x86-64",
"download_path" => "releases/supercardinality.exe", "download_path" => "",
"download_filename" => "supercardinality.exe", "download_filename" => "supercardinality.exe",
], ],
]; ];
+14 -1
View File
@@ -12,9 +12,22 @@ $version_timestamp = empty($latest["timestamp"]) ? -1 : $latest["timestamp"];
$version_timestamp_in_words = timestamp_in_words($version_timestamp); $version_timestamp_in_words = timestamp_in_words($version_timestamp);
if (!empty($latest["linux_path"])) { if (!empty($latest["linux_path"])) {
$options["linux"]["download_path"] = "releases/" . $latest["linux_path"]; $options["linux"]["download_path"] = $latest["linux_path"];
if (!str_contains($latest["linux_path"], "://")) {
$options["linux"]["download_path"] = "releases/" . $options["linux"]["download_path"];
}
} }
if (!empty($latest["windows_path"])) { if (!empty($latest["windows_path"])) {
$options["windows"]["download_path"] = "releases/" . $latest["windows_path"]; $options["windows"]["download_path"] = "releases/" . $latest["windows_path"];
if (!str_contains($latest["windows_path"], "://")) {
$options["windows"]["download_path"] = "releases/" . $options["windows"]["download_path"];
}
}
$display_other_builds = false;
foreach($options as $os => $target) {
if (!empty($target["download_path"])) {
$display_other_builds = true;
}
} }
+14 -2
View File
@@ -119,6 +119,11 @@ footer {
&:hover, &:hover,
&:active { &:active {
background: var(--gold); background: var(--gold);
& > * {
background: #211e29;
color: white;
}
} }
& > * { & > * {
@@ -129,11 +134,18 @@ footer {
color: var(--gold); color: var(--gold);
font: 600 19px/1 var(--serif); font: 600 19px/1 var(--serif);
letter-spacing: 0.1em; letter-spacing: 0.1em;
}
&.disabled {
filter: brightness(50%);
&:hover, &:hover,
&:active { &:active {
background: #211e29; background: linear-gradient(152deg, var(--gold) 0%, var(--gold-mid) 28%, var(--gold-very-dark) 54%, var(--gold-mid) 76%, var(--gold) 100%);
color: white; & > * {
background: #17131a;
color: var(--gold);
}
} }
} }
} }