forked from Keshi/ScalaWilliam.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.php
More file actions
34 lines (32 loc) · 966 Bytes
/
sitemap.php
File metadata and controls
34 lines (32 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$title = 'Sitemap';
if ( !defined('DIRECT')) {
require(dirname(__FILE__).DIRECTORY_SEPARATOR."shared".DIRECTORY_SEPARATOR."render.inc.php");
?>
<div class="section" id="william">
<h2>Sitemap</h2>
</div>
<?php } ?>
<section class="sitemap">
<dl>
<?php
foreach(explode("\n", shell_exec("find out -iname '*.html'")) as $html) {
$filename = $html;
$html = preg_replace("/index.html$/", "", $html);
$html = preg_replace("/^out/", "", $html);
if ( empty($html)) continue;
if ( $html == "/404.html") continue;
$title = $html;
if ( preg_match("/<title>(.*)<\\/title>/", file_get_contents($filename), $m) ) {
$title = $m[1];
}
echo "<dt><a href='$html'>$title</a></dt>";
echo "<dd><a href='$html'>$html</a></dd>";
}
?>
</dl>
</section>
<?php
if ( !defined('DIRECT')) {
echo $foot;
}