summaryrefslogtreecommitdiff
path: root/includes/render_index.php
blob: d90627bd44e3d180ba053f229fdeb348ecc1ff19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<header>
	<noscript>
		JavaScript? Where we're going we don't need JavaScript.
	</noscript>
</header>

<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>