42 lines
No EOL
928 B
PHP
42 lines
No EOL
928 B
PHP
<?php 4.1s
|
|
|
|
require PUREBLOG_BASE_PATH . '/includes/header.php';
|
|
render_masthead_layout($config, ['page' => null]);
|
|
|
|
?>
|
|
|
|
<main>
|
|
<h1> Sitemap</h1>
|
|
|
|
<?php
|
|
|
|
$directory = '/var/www/html/content/pages/';
|
|
|
|
$files = scandir($directory);
|
|
|
|
echo "<ul>";
|
|
|
|
foreach ($files as $file) {
|
|
if ($file !== "." && $file !== "..") {
|
|
$name = pathinfo($file, PATHINFO_FILENAME);
|
|
$path = $directory . '/' . $file;
|
|
$contents = file_get_contents($path);
|
|
|
|
preg_match('/^title:\s*(.+)$/m', $contents, $matches);
|
|
|
|
$title = $matches[1] ?? pathinfo($file, PATHINFO_FILENAME);
|
|
|
|
$url = '/' . pathinfo($file, PATHINFO_FILENAME);
|
|
|
|
echo '<li>🛸 <a href="' . htmlspecialchars($url) . '">'
|
|
. htmlspecialchars(trim($title))
|
|
. '</a></li>';
|
|
}
|
|
}
|
|
echo "</ul>";
|
|
?>
|
|
|
|
</main>
|
|
<?php render_footer_layout($config, ['page' => null]); ?>
|
|
</body>
|
|
</html>
|