Browse Source

define macros for base URL

main
ghost 11 months ago
parent
commit
a053b31c36
  1. 10
      src/server.php

10
src/server.php

@ -164,6 +164,16 @@ $server->setHandler(
// Read document // Read document
$reader = new \Yggverse\Gemini\Dokuwiki\Reader(); $reader = new \Yggverse\Gemini\Dokuwiki\Reader();
// Define base URL
$reader->setMacros(
'~URL:base~',
sprintf(
'gemini://%s%s/',
$config->gemini->server->host,
$config->gemini->server->port == 1965 ? null : ':' . $config->gemini->server->port
)
);
$response->setContent( $response->setContent(
$reader->toGemini( $reader->toGemini(
file_get_contents( file_get_contents(

Loading…
Cancel
Save