Browse Source

replace document links with it h1 header

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

12
src/server.php

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

Loading…
Cancel
Save