1
0
Fork 0
chickadee/index.php

46 lines
1.3 KiB
PHP

<?php
// Get the file list
$files = array_values( array_diff( scandir( "./posts" ), array('..', '.')));
rsort($files);
include_once "common.php";
include_once "config.php";
?>
<!DOCTYPE html>
<html lang="<?php echo SITE_LANG; ?>">
<head>
<title><?php echo SITE_NAME; ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php if ( SIMPLE_CSS ): ?>
<link rel="stylesheet" href="/css/simple.css">
<?php endif; ?>
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/admin-bar.css">
</head>
<body class="index">
<?php include_once "admin-bar-partial.php"; ?>
<header>
<?php if ( SITE_HEADER ): ?>
<?php echo SITE_HEADER; ?>
<?php else: ?>
<h1><a href="/"><?php echo SITE_NAME; ?></a></h1>
<?php endif; ?>
</header>
<main>
<?php
echo TOP_BLURB;
if ( count( $files ) > 0 ) {
echo "<ul>";
foreach( $files as $f ) {
$date = SHOW_DATE ? '<span class="post-date">' . split_filename( $f )["time"] . '</span>' : "";
$link = make_post_link( $f );
echo "<li><span class=\post-link\">$link</span> $date</li>";
}
echo "</ul>";
}
?>
</main>
<?php if (FOOT_BLURB) echo FOOT_BLURB; ?>
</body>
</html>