From: Christian Weiske Date: Wed, 3 Sep 2025 20:18:05 +0000 (+0200) Subject: add index content page X-Git-Tag: v0.9.0 X-Git-Url: https://git.cweiske.de/gamestick-pjgsapi.git/commitdiff_plain add index content page --- diff --git a/.gitignore b/.gitignore index 02b63ab..972c68a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /www/frodo /www/gamestick-api-docs.htm /www/game/ +/www/index.htm diff --git a/bin/build-html.php b/bin/build-html.php index ab11b57..1c7f92c 100755 --- a/bin/build-html.php +++ b/bin/build-html.php @@ -60,19 +60,12 @@ if (!is_dir($wwwDiscoverDir)) { mkdir($wwwDiscoverDir, 0755); } -/* -$gameFiles = [ - '../game-data/classic/de.eiswuxe.blookid.json', - '../game-data/classic/com.Refresh_Creations_Ltd.Super_Grid_Run.json',//video - '../game-data/classic/com.ubisoft.princeofpersia.shadowandflame.ggp.json',//achievements - '../game-data/classic/com.crescentmoongames.mimpi.json',//products -]; -*/ +$contentDir = __DIR__ . '/../content/'; $mainNav = [ 'discover/' => 'Games', 'discover/media.htm' => 'Media', - //'/' => 'About', + '/' => 'About', ]; $subNav = [ 'discover/' => 'Featured', @@ -276,6 +269,33 @@ foreach ($gameFiles as $gameDataFile) { } +//Content pages +file_put_contents( + $wwwDir . 'index.htm', + renderContentPage( + 'PlayJam GameStick community server', 'index.htm', + $mainNav, [], '/' + ) +); + + +function renderContentPage( + string $title, string $path, + array $mainNav, array $subNav, + string $mainNavActivePath, string $subNavActivePath = null +): string { + $content = file_get_contents($GLOBALS['contentDir'] . $path); + $canonicalUrl = $GLOBALS['baseUrl'] . $path; + $pageTemplate = __DIR__ . '/../data/templates/page.tpl.php'; + + ob_start(); + include $pageTemplate; + $html = ob_get_contents(); + ob_end_clean(); + + return $html; +} + function renderGameFile($gameDataFile, $path): string { $json = json_decode(file_get_contents($gameDataFile)); diff --git a/content/index.htm b/content/index.htm new file mode 100644 index 0000000..8315885 --- /dev/null +++ b/content/index.htm @@ -0,0 +1,33 @@ +

PlayJam GameStick community server

+

+ The PlayJam GameStick was an Android based gaming micro-console, + released in 2013. + In 2017 + the official server shut down, + bricking the GameSticks that need the server to function. +

+

+ After several years of dedicated work, + the + server API + has been reverse engineered and documented, + meta data + of all 188 games have been collected, + game files and firmware version have been + archived + and a replacement server software has been + implemented. +

+

+ This community server lets you register a new user account for brand new + or factory reset GameSticks, browse the game library, + download and nearly all of the games! +

+

+ Because not all games have been archived yet, GameSticks need to be manually + whitelisted - see the + blog post + for more information about that. +

+ +GameStick box cover diff --git a/data/templates/page.tpl.php b/data/templates/page.tpl.php new file mode 100644 index 0000000..ad07a73 --- /dev/null +++ b/data/templates/page.tpl.php @@ -0,0 +1,65 @@ + + + + + <?= htmlspecialchars($title); ?> + + + + + + + +
+ + PlayJam GameStick Logo + +
+ + + + + +
+ + + + +
+ +
+
+ + diff --git a/www/css/discover.css b/www/css/discover.css index ec68d56..202c155 100644 --- a/www/css/discover.css +++ b/www/css/discover.css @@ -367,3 +367,24 @@ header { display: none; } } + +#content article { + margin-left: 20px; + margin-right: 20px; + max-width: 50rem; +} +#content article h1 { + margin-top: 0px; +} +#content article a, +#content article a:visited { + font-weight: normal; + color: white; +} +#content article > img { + display: block; + margin-left: auto; + margin-right: auto; + max-width: 80%; + height: auto; +} diff --git a/www/img/box-gamestick.2048.jpg b/www/img/box-gamestick.2048.jpg new file mode 100644 index 0000000..acb23b3 Binary files /dev/null and b/www/img/box-gamestick.2048.jpg differ