diff options
Diffstat (limited to 'pages/index.php')
-rw-r--r-- | pages/index.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pages/index.php b/pages/index.php new file mode 100644 index 0000000..18476bc --- /dev/null +++ b/pages/index.php @@ -0,0 +1,18 @@ +<h1 style="text-align: center"> + The World Wide Web pages of Adam Carpenter (53hornet) +</h1> + +<ul> + <?php + $posts = scandir('./posts', SCANDIR_SORT_DESCENDING); + $posts = array_filter($posts, fn ($post) => !empty($post) && $post != '.' && $post != '..'); + #$posts = array_slice($posts, 0, 1000); + + foreach ($posts as &$post) { + $title = str_replace('h1', 'span', fgets(fopen("./posts/$post", 'r'))); + $date = str_split($post, 10)[0]; + $post = str_replace('.php', '', $post); + printf('<li> <code>%s</code> <a href="/%s">%s</a> </li>', $date, $post, $title); + } + ?> +</ul> |