1
0
Fork 0
isopod.cool/blog/posts/post.php
will 65a3e92d28 - Restructured blog
- Most blog posts are now written and stored as markdown
 - Markdown parsing and dynamic rendering for blog posts has been moved to a single file
 - Title for blog posts is now pulled from atom feed, just like dates
 - Changed code block styling and slightly altered content of some posts for compatibility with markdown parsing
 - Removed some old blog posts I'm no longer proud of
- Added link to deeptwisty.com to navbar on /
2024-09-10 04:42:07 -06:00

45 lines
1.5 KiB
PHP

<?php
$cwd = preg_replace('/^.*\//', '', getcwd());
$feed = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."/blog/blog.atom");
$pdate = "";
$udate = "";
$title = "";
$descr = "";
foreach($feed->entry as $entry) {
if($entry->id == $cwd) {
$pdate = preg_replace('/T.*$/', ' ', $entry->published);
$udate = preg_replace('/T.*$/', ' ', $entry->updated);
$title = $entry->title;
$descr = $entry->summary;
break;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo($title); ?></title>
<?php echo("<meta name='description' content='$descr'>"); ?>
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
<link href="/blog/comment/comments.css" rel="stylesheet" type="text/css" media="all">
<style>
h1 {
background-image: url('bg.svg'), url('bg.png'), url('bg.jpg'), url('bg.webp');
}
</style>
</head>
<body>
<?php
include($_SERVER['DOCUMENT_ROOT'] . '/nav.php');
$udates = "";
if($pdate != $udate) { $udates = " | Updated&nbsp;on&nbsp;$udate"; }
echo("<h1>isoblog</h1><h2 id='caption'>$title</h2><p style='text-align: center;'><em>Posted&nbsp;on&nbsp;$pdate$udates</em></p>");
include("../Parsedown.php");
$Parsedown = new Parsedown();
echo $Parsedown->text(file_get_contents("index.md"));
include("../../comment/form.php");
?>
</body>
</html>