mirror of
https://codeberg.org/rdelaage/ergol-http.git
synced 2024-09-27 20:02:15 +02:00
Merge pull request 'Add template file' (#1) from rdelaage/ergol-http:main into main
Reviewed-on: https://codeberg.org/adele.work/ergol-http/pulls/1
This commit is contained in:
commit
ef4ced4502
44
index.php
44
index.php
@ -355,44 +355,10 @@ function gmi2html($capsule, $body, $lang, $urlgem, $favicon)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$html = '<!DOCTYPE html>
|
$style = file_get_contents(__DIR__.'/style.css');
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="'.$lang.'">
|
ob_start();
|
||||||
<head>
|
include "template.php";
|
||||||
<meta charset="utf-8">
|
$html = ob_get_contents();
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
ob_end_clean();
|
||||||
<title>'.htmlentities($title.' | '.$urlgem).'</title>
|
|
||||||
<link rel="alternate" href="'.$urlgem.'" type="text/gemini" title="Gemini protocol">
|
|
||||||
<style media="screen">
|
|
||||||
'.@file_get_contents(__DIR__.'/style.css').'
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body id="top">';
|
|
||||||
if(count($tocs)>1)
|
|
||||||
{
|
|
||||||
$html.= '<div class="toc" role="navigation">
|
|
||||||
<span class="icon">⚓</span>
|
|
||||||
<ul>
|
|
||||||
'.implode("\n",$tocs).'
|
|
||||||
</ul>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
$html.= '
|
|
||||||
<label class="control" for="check-smaller">🔍 -</label>
|
|
||||||
<input type="radio" name="check-size" id="check-smaller" class="control check-smaller" />
|
|
||||||
<input type="radio" name="check-size" id="check-small" class="control check-small" />
|
|
||||||
<input type="radio" name="check-size" id="check-normal" class="control check-normal" checked="checked" />
|
|
||||||
<input type="radio" name="check-size" id="check-big" class="control check-big" />
|
|
||||||
<input type="radio" name="check-size" id="check-bigger" class="control check-bigger" />
|
|
||||||
<label class="control" for="check-bigger">+</label>
|
|
||||||
<div class="main" role="article">
|
|
||||||
'.implode("\n",$lines).'
|
|
||||||
</div>
|
|
||||||
<div class="topanchor"><a href="#top">🔝</a></div>
|
|
||||||
<div class="gemini" role="banner">
|
|
||||||
<span>'.$favicon.'</span>
|
|
||||||
<a href="'.$urlgem.'" title="Gemini address">'.htmlentities($urlgem).'</a>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>';
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
41
template.php
Normal file
41
template.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $lang; ?>">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title><?php echo $title; ?></title>
|
||||||
|
<link rel="alternate" href="<?php echo $urlgem; ?>" type="text/gemini" title="Gemini protocol">
|
||||||
|
<style media="screen">
|
||||||
|
<?php echo $style; ?>
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body id="top">
|
||||||
|
<?php if(count($tocs)>1)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<div class="toc" role="navigation">
|
||||||
|
<span class="icon">⚓</span>
|
||||||
|
<ul>
|
||||||
|
<?php echo implode("\n",$tocs); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<label class="control" for="check-smaller">🔍 -</label>
|
||||||
|
<input type="radio" name="check-size" id="check-smaller" class="control check-smaller" />
|
||||||
|
<input type="radio" name="check-size" id="check-small" class="control check-small" />
|
||||||
|
<input type="radio" name="check-size" id="check-normal" class="control check-normal" checked="checked" />
|
||||||
|
<input type="radio" name="check-size" id="check-big" class="control check-big" />
|
||||||
|
<input type="radio" name="check-size" id="check-bigger" class="control check-bigger" />
|
||||||
|
<label class="control" for="check-bigger">+</label>
|
||||||
|
<div class="main" role="article">
|
||||||
|
<?php echo implode("\n",$lines); ?>
|
||||||
|
</div>
|
||||||
|
<div class="topanchor"><a href="#top">🔝</a></div>
|
||||||
|
<div class="gemini" role="banner">
|
||||||
|
<span><?php echo $favicon; ?></span>
|
||||||
|
<a href="<?php echo $urlgem; ?>" title="Gemini address"><?php echo htmlentities($urlgem); ?></a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user