aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorwinter2024-12-23 18:20:25 +0000
committerwinter2024-12-23 18:20:25 +0000
commitbccad1118364427ea5c97c08d132fd128368760b (patch)
tree449a4f5b36309e1e80694718f72ebc6e136e0140 /templates
parent094b1d010253f1a9a114303d823739e513834742 (diff)
make a crummy template system and use it for global timeline
Diffstat (limited to 'templates')
-rw-r--r--templates/global_timeline.php6
-rw-r--r--templates/note.php11
-rw-r--r--templates/skeleton.php22
3 files changed, 39 insertions, 0 deletions
diff --git a/templates/global_timeline.php b/templates/global_timeline.php
new file mode 100644
index 0000000..dbecd7b
--- /dev/null
+++ b/templates/global_timeline.php
@@ -0,0 +1,6 @@
+<?php call_template('skeleton', ['pageTitle' => 'Global timeline'], function () {
+ global $notes;
+ foreach ($notes as $n) {
+ call_template('note', ['note' => $n]);
+ }
+}); \ No newline at end of file
diff --git a/templates/note.php b/templates/note.php
new file mode 100644
index 0000000..c3ec9fd
--- /dev/null
+++ b/templates/note.php
@@ -0,0 +1,11 @@
+<article class="note">
+ <img class="authorAvatar" src="<?= $note->author->avatar ?>">
+ <div>
+ <a class="authorName" <?= isset($note->author->homepage) ? 'href="' . $note->author->homepage . '"' : '' ?>>
+ <?= $note->author->displayName ?>
+ </a>
+ <div class="postContent">
+ <?= $note->plainContent ?>
+ </div>
+ </div>
+</article> \ No newline at end of file
diff --git a/templates/skeleton.php b/templates/skeleton.php
new file mode 100644
index 0000000..d1e08e0
--- /dev/null
+++ b/templates/skeleton.php
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <title><?= $pageTitle ?></title>
+ <link rel="stylesheet" href="/static/style.css">
+</head>
+
+<body>
+ <header>
+ <span id="siteTitle">Digitigrade???????</span>
+ <nav>
+ <span>navigation links go here i suppose?</span>
+ </nav>
+ </header>
+ <main>
+ <h1><?= $pageTitle ?></h1>
+ <?php slot(); ?>
+ </main>
+</body>
+
+</html> \ No newline at end of file