summaryrefslogtreecommitdiff
path: root/rawdog/page.template
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2018-06-19 16:35:15 +0100
committerAdam Spragg <adam@spra.gg>2018-06-19 16:35:15 +0100
commit2f5472519016b3092dea07d6f041b1cb74c3cd13 (patch)
tree404cf9eef936a67e91b5dc1a6a066fd5f336d366 /rawdog/page.template
parent65c5c4043fe05ed4d94f3530c405363d3aee541c (diff)
Output the page head/header/footer with PHP
Allows putting all the repeated stuff in one place (DRY!), so that if it needs changing it only needs to change once. Start the name of the included file with "@", and disallow the retrieval of files beginning with "@" (returning 404) so that it can't be downloaded, because it won't output anything meaningful. Why "@"? Because it's about the only ASCII punctuation character that doesn't mean anything special to most shells (bash), or programs, and is therefore easy to use as a filename on the command line. I almost went with "+", but it turns out that nvim treats arguments beginning with "+" as options. So "@" it is.
Diffstat (limited to 'rawdog/page.template')
-rw-r--r--rawdog/page.template17
1 files changed, 4 insertions, 13 deletions
diff --git a/rawdog/page.template b/rawdog/page.template
index 4c0528b..050f719 100644
--- a/rawdog/page.template
+++ b/rawdog/page.template
@@ -1,23 +1,13 @@
-<!DOCTYPE html>
+<?php include '@include.php'; ?><!DOCTYPE html>
<html lang="en">
<head>
- <title>Blog</title>
- <link rel="stylesheet" href="/style/main.css" type="text/css" />
+ <?php echo indent(site_head('Blog - Spragg Software Services Ltd.'), 2); ?>
<meta name="robots" content="noindex,nofollow,noarchive">
__refresh__
</head>
<body>
<header>
- <h1>Blog</h1>
- <nav>
- <ul>
- <li><a href="/">Home</a></li>
- <li><a href="/projects">Projects</a></li>
- <li class="selected"><a href="/blog">Blog</a></li>
- <li><a href="/privacy">Privacy</a></li>
- <li><a href="/contact">Contact</a></li>
- </ul>
- </nav>
+ <?php echo indent(site_header('Blog'), 3); ?>
</header>
<main>
<section class="items">__items__</section>
@@ -29,6 +19,7 @@
<footer>
<p id="aboutrawdog">Generated by <a href="http://offog.org/code/rawdog.html">rawdog</a> version
__version__</p>
+ <?php echo indent(site_footer(), 3); ?>
</footer>
</body>
</html>