This minimalist blog uses simple html. No Javascript, grids, or
fancy formats. It can be read in a terminal text browser like
Lynx, a simple
graphical browser like Dillo, or a state
of the art browser like Firefox.
(see examples)
isDir() && !$dirinfo->isDot()) {
$yeardirs[] = $dirinfo->getFilename();
}
}
rsort($yeardirs);
// iterate through years
if (is_array($yeardirs)) {
foreach ($yeardirs as $key => $dirname) {
echo "" . $dirname . "
";
echo "";
$items = [];
$thisdir = new DirectoryIterator("./articles/" . $dirname);
// iterate through files
foreach ($thisdir as $file) {
if ($file != "." && $file != "..") {
$content = file_get_contents($file->getPathname());
preg_match("/(.*?)<\/h5>/s", $content, $date);
$filedate = date("Y-m-d");
if (isset($date[1]) && strtotime($date[1])) {
$filedate = date("Y-m-d", strtotime($date[1]));
}
preg_match("/(.*?)<\/h2>/s", $content, $titre);
$title = "?";
if (isset($titre[1])) {
$title = $titre[1];
}
$items[] =
"
- " .
$filedate .
' ' .
$title .
"
";
}
}
rsort($items);
foreach ($items as $key => $val) {
echo $val;
}
echo "
";
}
} else {
echo "Not an array";
}
?>