1
0
Fork 0
chickadee/index.php

53 lines
1.6 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">
<link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> RSS Feed" href="/rssFeed.xml">
<?php echo INDEX_HEAD ?: ""; ?>
</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 if (TOP_BLURB) echo TOP_BLURB; ?>
<?php
if ( count( $files ) > 0 ) {
echo '<ul class="post-list">';
foreach( $files as $f ) {
$date = SHOW_DATES ? '<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>";
}
?>
<?php if (FOOT_BLURB) echo FOOT_BLURB; ?>
</main>
<?php if ( SITE_FOOTER ): ?>
<footer>
<?php echo SITE_FOOTER; ?>
</footer>
<?php endif; ?>
</body>
</html>