-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
260 lines (218 loc) · 12.1 KB
/
index.php
File metadata and controls
260 lines (218 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html lang="en-US">
<!-- HEAD -->
<head>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Files -->
<link rel="shortcut icon" href="/assets/icon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/style.css">
<!-- Links -->
<link rel="indieauth-metadata" href="https://roadlessread.com/.well-known/oauth-authorization-server" />
<link rel="authorization_endpoint" href="https://roadlessread.com/auth/" />
<link rel="token_endpoint" href="https://roadlessread.com/auth/token.php" />
<link rel="me" href="mailto:hi@zacharykai.net">
<link rel="me" href="https://github.com/zk-codes">
<link rel="micropub" href="https://roadlessread.com/micropub/" />
<link rel="alternate" type="application/rss+xml" title="Road Less Read" href="/assets/rss.xml">
<link rel="webmention" href="https://webmention.io/zacharykai.net/webmention" />
<!-- Page Details -->
<title>Road Less Read: Better Books For Better Reading</title>
<link rel="canonical" href="https://roadlessread.com/">
<meta name="date" content="2019-06-02">
<meta name="last-modified" content="2025-08-20">
<meta name="description" content="">
</head>
<body>
<!-- SIDEBAR-->
<aside class="sidebar">
<!-- Skip/Return Link -->
<p><a href="#top" class="smalltext">Skip/Return To Top</a></p>
<!-- Mobile Menu Toggle -->
<input type="checkbox" id="menu-toggle" class="menu-toggle">
<!-- Menu -->
<header>
<!-- Mobile Menu -->
<div style="display: flex; justify-content: space-between; align-items: center;">
<p class="sitetitle"><a href="/">Road Less Read</a></p>
<label for="menu-toggle" class="menu-icon">
<span></span>
<span></span>
<span></span>
</label>
</div>
<!-- Menu Items -->
<nav>
<!-- Collections --->
<p><strong>Collections</strong></p>
<p>
<a href="/jots/">Jots</a> •
<a href="/lists/">Lists</a> •
<a href="/tools/">Tools</a>
</p>
<p>
<a href="/notes/">Notes</a> •
<a href="/reviews/">Reviews</a> •
<a href="/views/">Views</a>
</p>
<!-- Pages -->
<p class="pages"><strong>Pages</strong></p>
<p>
<a href="/about">About</a> •
<a href="/links">Links</a> •
<a href="/sitemap">Sitemap</a>
</p>
</nav>
<!-- Subscribe link -->
<p class="highlight"><a href="/subscribe">Subscribe</a></p>
</header>
<p class="smalltext">Est. 2019</p>
</aside>
<!-- MAIN CONTENT -->
<main class="main-content-area h-entry">
<!-- Header -->
<header>
<!-- Breadcrumbs -->
<p class="smalltext">You Are Here → <a href="/">Homepage</a> ↴</p>
<!-- Heading -->
<h1 class="p-name">Enough With The Doomscrolling!</h1>
<!-- Metadata -->
<p class="smalltext">
<!-- Author --->
<strong>Written By</strong>: <a href="/about" class="p-author h-card" rel="author">Zachary Kai</a> »
<!-- Date Written -->
<strong>Published</strong>: <time class="dt-published" datetime="2019-06-02">2 Jun 2019</time> |
<!-- Date Updated -->
<strong>Updated</strong>: <time class="dt-updated" datetime="2025-11-15">15 Nov 2025</time>
</p>
<!-- Invisible Microformats -->
<p style="display: none;" class="p-summary">Road Less Read is a book, literature, writing, and zine site with lists, resources, and tools.</p>
</header>
<?php require_once '/home/zacharykai/crons/currentread.php'; ?>
<!-- Introduction -->
<section class="e-content">
<section>
<p id="top" class="dropcap">Better books for better reading. Find ones you <strong>actually</strong> want to read, <em>fast</em>. <a href="/sitemap">Browse</a> for what you like, and I'll recommend one! Or, find it among my favorites in <a href="/lists/read">this list</a>.</p>
</section>
<!-- Featured Image -->
<section>
<img class="u-photo" src="/assets/imgs/decorative/booksonshelves2.png" alt="Books on shelves, filtered via dithering." loading="lazy">
<p class="caption">Photo Credit: Christine Neale</p>
</section>
<!-- Currently Reading -->
<?php render_currently_reading(); ?>
<section>
<!-- Latest Entries -->
<h2>Latest Entries</h2>
<ul>
<?php
// Source Directories
$directories = [
__DIR__ . '/lists/',
__DIR__ . '/notes/',
__DIR__ . '/reviews/',
__DIR__ . '/tools/',
__DIR__ . '/views/',
];
$posts = [];
// Scan directories for HTML and PHP files
foreach ($directories as $currentDir) {
if (is_dir($currentDir)) {
$files = scandir($currentDir);
foreach ($files as $file) {
$extension = pathinfo($file, PATHINFO_EXTENSION);
if (($extension === 'html' || $extension === 'php') && !preg_match('/^index\./', $file)) {
$filePath = $currentDir . $file;
$content = file_get_contents($filePath);
$title = '';
$dateAttr = '';
// Extract Title & Remove " | Road Less Read"
if (preg_match('/<title>(.*?)<\/title>/s', $content, $matches)) {
$fullTitle = trim($matches[1]);
$title = preg_replace('/\s*[\|\-]\s*Road Less Read$/i', '', $fullTitle);
}
// Extract DateTime Attribute
if (preg_match('/<time\s+class="dt-published"\s+datetime="([^"]+)">.*?<\/time>/s', $content, $matches)) {
$dateAttr = $matches[1];
}
if (!empty($title) && !empty($dateAttr)) {
$slug = pathinfo($file, PATHINFO_FILENAME);
$formattedDisplayDate = date('j M Y', strtotime($dateAttr));
// Determine the URL path based on the directory
$relativePath = str_replace(__DIR__, '', $currentDir);
$relativePath = trim($relativePath, '/');
$url = '/' . $relativePath . '/' . $slug;
$posts[] = [
'title' => $title,
'date_attr' => $dateAttr,
'display_date' => $formattedDisplayDate,
'url' => $url,
];
}
}
}
}
}
// Sort Posts In Descending Order
usort($posts, function($a, $b) {
return strtotime($b['date_attr']) - strtotime($a['date_attr']);
});
// Get Latest Fifteen Posts
$latestFifteenPosts = array_slice($posts, 0, 15);
// Output Posts
foreach ($latestFifteenPosts as $post) {
echo ' <li><a href="' . htmlspecialchars($post['url']) . '">' . htmlspecialchars($post['title']) . '</a> | ' . htmlspecialchars($post['display_date']) . '</li>' . "\n";
}
?>
</ul>
</section>
<!-- Site Navigation -->
<section>
<p>To see everything that's on this site, visit <a href="/sitemap.html">the sitemap</a>. You can also browse by <a href="/lists/">lists</a>, <a href="/notes/">notes</a>, and <a href="/reviews/">reviews</a>. Happy reading, and hope you find something useful!</p>
</section>
<!-- Copy & Share Link -->
<section>
<p class="smalltext"><strong>Copy + Share</strong>: <a href="https://roadlessread.com/" class="u-url">roadlessread.com</a></p>
</section>
</section>
<!-- Divider -->
<section class="end" aria-hidden="true"></section>
<!-- FOOTER -->
<footer>
<!-- Newsletter Signup -->
<section class="newsletter">
<p><strong><em>The Internet Isn’t Fun Anymore. I Have Nothing To Read.</em></strong></p>
<p>Rubbish! It’s all there, but there’s no map. So skip the searching.</p>
<p><strong><a href="/subscribe">Get your curated books and curiosities delivered!</a></strong></p>
</section>
<!-- H-Card -->
<section class="h-card vcard">
<section id="h-card-image">
<picture>
<source srcset="/assets/icon.webp" type="image/webp">
<img class="u-photo" loading="lazy" src="/assets/icon.png" alt="Zachary Kai's digital drawing: 5 stacked books (blue/teal/green/purple, black spine designs), green plant behind top book, purple heart on either side.">
</picture>
</section>
<section id="h-card-content">
<p><strong><a class="u-url u-id p-name p-author" href="https://roadlessread.com/about" rel="me author">
<span class="fn">Zachary Kai</span></a></strong> —
<span class="p-pronouns">he/him</span> |
<a class="u-email email" href="mailto:hi@zacharykai.net" rel="me">hi@zacharykai.net</a></p>
<p class="p-note">Zachary Kai is a space fantasy writer, offbeat queer, traveler, zinester, and avowed generalist. The internet is his livelihood and lifeline.</p>
</section>
</section>
<!-- Acknowledgement Of Country -->
<section>
<p><strong>Acknowledgement Of Country</strong>: I owe my existence to the <a href="https://kht.org.au/" rel="noopener">Koori people's</a> lands: tended for millennia by the traditional owners and storytellers. What a legacy. May it prevail.</p>
</section>
<!-- Footer Links -->
<section>
<p><strong>Useful Links</strong>:
<a href="/changelog">Changelog</a> |
<a href="/random">Random Page</a></p>
</section>
</footer>
</main>
</body>
</html>