aboutsummaryrefslogtreecommitdiff
path: root/snippets
diff options
context:
space:
mode:
authorArno Richter <oelna@oelna.de>2022-12-13 22:27:21 +0100
committerArno Richter <oelna@oelna.de>2022-12-13 22:27:44 +0100
commit0b075f3ea2616cfde4d976199a69ba631174a336 (patch)
treebb1feef58d9c714f6c3fb0b75f1e52b0181cf2af /snippets
parentf0e3ff408db8ee40611f75cdf96892f90034bd60 (diff)
downloadmicroblog-0b075f3ea2616cfde4d976199a69ba631174a336.tar.gz
microblog-0b075f3ea2616cfde4d976199a69ba631174a336.tar.bz2
microblog-0b075f3ea2616cfde4d976199a69ba631174a336.zip
gave up and sorted files into a directory structure. made snippets for header, nav and footer. made it easier to add additional css files as themes. prepare a little for addition of a real template engine. added a css reset file to share between themes, if warranted.
Diffstat (limited to 'snippets')
-rw-r--r--snippets/footer.snippet.php10
-rw-r--r--snippets/header.snippet.php27
-rw-r--r--snippets/nav.snippet.php7
3 files changed, 44 insertions, 0 deletions
diff --git a/snippets/footer.snippet.php b/snippets/footer.snippet.php
new file mode 100644
index 0000000..d2238f0
--- /dev/null
+++ b/snippets/footer.snippet.php
@@ -0,0 +1,10 @@
+<footer>
+ <nav>
+ <ul>
+ <li><a href="<?= $config['url'] ?>/feed/atom">ATOM Feed</a></li>
+ <li><a href="<?= $config['url'] ?>/feed/json">JSON Feed</a></li>
+ <?php if($config['xmlrpc']): ?><li><a href="<?= $config['url'] ?>/xmlrpc">XML-RPC</a></li><?php endif; ?>
+ <?php if($config['logged_in']): ?><li><a href="<?= $config['url'] ?>/logout">Logout</a></li><?php endif; ?>
+ </ul>
+ </nav>
+</footer>
diff --git a/snippets/header.snippet.php b/snippets/header.snippet.php
new file mode 100644
index 0000000..d3270d8
--- /dev/null
+++ b/snippets/header.snippet.php
@@ -0,0 +1,27 @@
+<?php
+
+ $title_suffix = isset($title_suffix) ? ' - ' . $title_suffix : '';
+ $css = 'microblog'; // the default
+ if(!empty($config['theme']) && file_exists(ROOT.DS.'css'.DS.$config['theme'].'.css')) {
+ $css = $config['theme'];
+ }
+
+ header('Content-Type: text/html; charset=utf-8');
+
+?><!DOCTYPE html>
+<html lang="<?= $config['language'] ?>" class="<?= $template ?>">
+<head>
+ <meta charset="utf-8" />
+
+ <title><?= empty($config['microblog_account']) ? "" : $config['microblog_account'] . "'s "; ?>micro.blog<?= $title_suffix ?></title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+
+ <link rel="alternate" type="application/json" title="JSON Feed" href="<?= $config['url'] ?>/feed/json" />
+ <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="<?= $config['url'] ?>/feed/atom" />
+ <?php if($config['xmlrpc']): ?><link rel="EditURI" type="application/rsd+xml" title="RSD" href="<?= $config['url'] ?>/rsd" /><?php endif; ?>
+
+ <link rel="stylesheet" href="<?= $config['url'] ?>/css/<?= $css ?>.css" />
+
+ <script src="<?= $config['url'] ?>/microblog.js" type="module" defer></script>
+</head>
diff --git a/snippets/nav.snippet.php b/snippets/nav.snippet.php
new file mode 100644
index 0000000..3628451
--- /dev/null
+++ b/snippets/nav.snippet.php
@@ -0,0 +1,7 @@
+<nav class="main">
+ <ul>
+ <li><a class="button" href="<?= $config['url'] ?>/">Timeline</a></li>
+ <?php if($config['logged_in']): ?><li><a class="button" href="<?= $config['url'] ?>/new">New Status</a></li><?php endif; ?>
+ <?php if(!$config['logged_in']): ?><li><a class="button" href="<?= $config['url'] ?>/login">Login</a></li><?php endif; ?>
+ </ul>
+</nav>