X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FController%2FWikipage.php;h=3c07b6989f502cd55632775a7e1e424a23dd0333;hb=4c462ab66e6c65c15df7bd5fe6d2673884c639a0;hp=f350f9a993585d9a0c9fa31ea7d51622137cc4d9;hpb=7f4e70ea88d180cfa25f25f3846f842c5958ebf4;p=pharext%2Fpharext.org diff --git a/app/Controller/Wikipage.php b/app/Controller/Wikipage.php index f350f9a..3c07b69 100644 --- a/app/Controller/Wikipage.php +++ b/app/Controller/Wikipage.php @@ -19,6 +19,17 @@ class Wikipage implements Controller function __invoke(array $args = null) { $title = $args["page"]; + $this->app->getView()->addData(["title" => "About: $title"]); + if ($title === "Packager hook") { + $baseUrl = $this->app->getBaseUrl(); + $this->app->getView()->addData([ + "styles" => [$baseUrl->mod("./highlight/styles/dark.css")], + "scripts" => [ + $baseUrl->mod("./highlight/highlight.pack.js"), + "hljs.initHighlightingOnLoad();" + ] + ]); + } $page = $this->wikiPath($args["page"]); $this->app->display("pages/wiki", compact("title", "page")); } @@ -30,6 +41,7 @@ class Wikipage implements Controller return $s{0} !== "."; }); } + function wikiPath($page) { $file = basename(strtr($page, " ", "-"), ".md") . ".md"; return self::WIKI_PATH . $file;