summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoderndevslulw <moderndevslulw@alright.party>2025-07-12 00:12:23 +0500
committermoderndevslulw <moderndevslulw@alright.party>2025-07-12 00:12:23 +0500
commit9a80cec40d99c37a82bf59463a994a7e3313a579 (patch)
treec7aae2f7769bfc8124ee2b29de105e2f8841bf15
parent45c6dc58dfc49f62d58b9c5caad1343287ed0f38 (diff)
feat: external link for wikiHEADmaster
-rw-r--r--lib/partials.php2
-rwxr-xr-xpublic/static/img/icons/external_link.pngbin0 -> 343 bytes
-rw-r--r--public/wiki.php5
3 files changed, 7 insertions, 0 deletions
diff --git a/lib/partials.php b/lib/partials.php
index f08afb4..f64b32f 100644
--- a/lib/partials.php
+++ b/lib/partials.php
@@ -14,6 +14,8 @@ function html_navigation_bar()
<a href="/">home</a>
<?php if (is_dir(WIKI_PAGE_DIRECTORY)): ?>
<a href="/wiki.php">wiki</a>
+ <?php elseif (str_starts_with(WIKI_PAGE_DIRECTORY, "http")): ?>
+ <a href="<?= WIKI_PAGE_DIRECTORY ?>">wiki<img src="/static/img/icons/external_link.png"></a>
<?php endif; ?>
<?php if (!empty(LUA_SCRIPT_DIRECTORY)): ?>
<a href="/scripts.php">scripts</a>
diff --git a/public/static/img/icons/external_link.png b/public/static/img/icons/external_link.png
new file mode 100755
index 0000000..25eacb7
--- /dev/null
+++ b/public/static/img/icons/external_link.png
Binary files differ
diff --git a/public/wiki.php b/public/wiki.php
index b87405f..1f99be9 100644
--- a/public/wiki.php
+++ b/public/wiki.php
@@ -3,6 +3,11 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/../lib/partials.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/../vendor/autoload.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/../config.php';
+if (str_starts_with(WIKI_PAGE_DIRECTORY, "http")) {
+ header("Location: " . WIKI_PAGE_DIRECTORY);
+ exit;
+}
+
$page_id = $_GET['p'] ?? 'README';
$page_name = "$page_id.md";