123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" href="/style.css" />
- <title>Bloggings</title>
- </head>
- <body>
- <header>
- <center>
- <h1>Bloggings</h1>
- <img src="images/shadocks-pumping-300.gif" alt="shadocks pumping">
- <br><br>
- <a
- href="static.php">Static</a> | <a
- href="https://shaarli.wittamore.com" target="_blank">Links</a> | <a
- href="https://git.wittamore.com" target="_blank">Git</a> | <a
- href="search.php">Search</a> | <a
- href="https://wittamore-com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=fr&_x_tr_hl=en-GB&_x_tr_pto=wapp"
- >FR</a
- >
- </center>
- <hr />
- </header>
- <p>
- This <a href="/articles/2023/minimalist-blog.html">minimalist blog</a> uses simple html. No Javascript, grids, or
- fancy formats. It can be read in a terminal text browser like
- <a href="https://lynx.browser.org/">Lynx</a>, a simple
- graphical browser like <a href="https://dillo.org/">Dillo</a>, or a state
- of the art browser like <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a>.
- <a href="/images/browsers/index.php">(see examples)</a>
- </p>
- <!-- list start -->
- <?php
- // build reverse article subdirs (years)
- $yeardirs = [];
- $revyeardirs = [];
- $articlesubdir = new DirectoryIterator("./articles/");
- foreach ($articlesubdir as $dirinfo) {
- if ($dirinfo->isDir() && !$dirinfo->isDot()) {
- $yeardirs[] = $dirinfo->getFilename();
- }
- }
- rsort($yeardirs);
- // iterate through years
- if (is_array($yeardirs)) {
- foreach ($yeardirs as $key => $dirname) {
- echo "<h2>" . $dirname . "</h2>";
- echo "<ul>";
- $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>(.*?)<\/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>(.*?)<\/h2>/s", $content, $titre);
- $title = "?";
- if (isset($titre[1])) {
- $title = $titre[1];
- }
- $items[] =
- "<li><b>" .
- $filedate .
- ' </b><a href="' .
- $file->getPathname() .
- '">' .
- $title .
- "</a></li>";
-
- }
- }
- rsort($items);
- foreach ($items as $key => $val) {
- echo $val;
- }
- echo "</ul>";
- }
- } else {
- echo "Not an array";
- }
- ?>
- <!-- list end -->
- <p> </p>
- <hr />
- <center>
- <h5>
- A minimalist blog by
- <a
- href="mailto:%70%68%69%6C%69%70%40%77%69%74%74%61%6D%6F%72%65%2E%63%6F%6D"
- >Philip Wittamore</a
- >
- </h5>
- </center>
- </body>
- </html>
|