aboutsummaryrefslogtreecommitdiff
path: root/posts/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'posts/index.php')
-rw-r--r--posts/index.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/posts/index.php b/posts/index.php
new file mode 100644
index 0000000..1fe640e
--- /dev/null
+++ b/posts/index.php
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="icon" type="image/x-icon" href="../favicon.ico">
+ <title>deep twisty - posts</title>
+ <link href="../style.css" rel="stylesheet" type="text/css" media="all">
+ <link href="../subpage.css" rel="stylesheet" type="text/css" media="all">
+ <style>
+ article.post {
+ padding: 1rem;
+ max-width: 25rem;
+ margin: auto;
+ }
+ h2.datemarker {
+ margin-bottom: 0;
+ font-size: small;
+ }
+ .post p {
+ margin-top: 0.1rem;
+ }
+ </style>
+ </head>
+ <body>
+
+ <main>
+ <h1 id="header"><span id="headerblue">po</span><span id="headergreen">st</span><span id="headeryellow">s</span></h1>
+ <p><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="../">home</a><span style="display: inline-block; margin: 0 0.3rem; font-size: 0;"></span><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="https://journal.miso.town/atom?url=https://deeptwisty.com/posts/">feed</a></p><hr>
+ <div id="posts">
+ <?php
+ $infile = fopen("posts.txt", "r") or die("file read error -_-");
+ $content = fread($infile,filesize("posts.txt"));
+ fclose($infile);
+ $post_arr = explode("\n",$content);
+ $posts_out = "";
+ foreach($post_arr as $p) {
+ if(strlen($p) > 3) {
+ $date = substr($p, 0, strpos($p, " "));
+ $pcont = substr($p, strpos($p, " ") + 1);
+ $posts_out = "<article class='post'><h2 class='datemarker'>$date</h2><p>$pcont</p></article>$posts_out";
+ }
+ }
+ echo $posts_out;
+ ?>
+ </div>
+ </main>
+
+ </body>
+
+</html>