New blog entry and changes to how blogs are displayed

- blogs are now in subdirs
 - blog list is generated through helper function
 - full blog list is in blog subdir
This commit is contained in:
2023-10-30 12:47:55 -04:00
parent 2d90cc6151
commit 1bc1454b93
9 changed files with 100 additions and 45 deletions

View File

@ -64,24 +64,9 @@
</p>
</hgroup>
<p id="blogpreview">
<?php
$path = "blog";
$files = scandir($path."/");
$i = 0;
foreach ($files as $file) {
if (preg_match("/.+?(?=\.html|\.php)/", $file, $matches)) {
if ($i > 4)
break;
$tags = get_meta_tags($path.'/'.$file);
printf('<a href='.$path.'/%s>%s</a><span>%s</span><br>',
$matches[0], str_replace("-", " ", $matches[0]),
$tags["date"] ? $tags["date"] : "¯\_(ツ)_/¯");
$i++;
}
}
?>
<?php include('misc/tools.php'); entries("blog", 5); ?>
</p>
<a href="/blog.php">more...</a>
<a href="/blog">more...</a>
</div>
</div>
</div>