Browse Source

replace document links with it h1 header

main
ghost 10 months ago
parent
commit
cea89fd8ea
  1. 12
      src/server.php

12
src/server.php

@ -144,6 +144,9 @@ $server->setHandler( @@ -144,6 +144,9 @@ $server->setHandler(
}
*/
// Init reader
$reader = new \Yggverse\Gemini\Dokuwiki\Reader();
// Build home page
$lines = [
PHP_EOL
@ -204,11 +207,18 @@ $server->setHandler( @@ -204,11 +207,18 @@ $server->setHandler(
foreach ($filesystem->getPagePathsByPath($directory) as $file)
{
$pages[] = sprintf(
'=> gemini://%s%s/%s',
'=> gemini://%s%s/%s %s',
$config->gemini->server->host,
$config->gemini->server->port == 1965 ? null : ':' . $config->gemini->server->port,
$filesystem->getPageUriByPath(
$file
),
$reader->getH1(
$reader->toGemini(
file_get_contents(
$file
)
)
)
);
}

Loading…
Cancel
Save