summaryrefslogtreecommitdiff
path: root/html/index.php
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 /html/index.php
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 'html/index.php')
-rw-r--r--html/index.php26
1 files changed, 4 insertions, 22 deletions
diff --git a/html/index.php b/html/index.php
index 89ea644..29e0cfa 100644
--- a/html/index.php
+++ b/html/index.php
@@ -1,26 +1,11 @@
-<!DOCTYPE html>
+<?php include '@include.php'; ?><!DOCTYPE html>
<html lang="en">
<head>
- <title>Spragg Software Services Ltd.</title>
- <link rel="stylesheet" href="/style/main.css" />
- <!--
- Hi there. Nice to see you here. Feel free to have a look around. Also check out the /about page
- while you're at it. It's got a little bit more info about the site and the resources used.
- -->
+ <?php echo indent(site_head('Spragg Software Services Ltd.'), 2); ?>
</head>
<body>
<header>
- <h1>Spragg Software Services Ltd.</h1>
- <nav>
- <ul>
- <li class="selected"><a href="/">Home</a></li>
- <li><a href="/projects">Projects</a></li>
- <li><a href="/blog">Blog</a></li>
- <li><a href="/privacy">Privacy</a></li>
- <li><a href="/contact">Contact</a></li>
- <!--li><a href="/about">About</a></li-->
- </ul>
- </nav>
+ <?php echo indent(site_header('Spragg Software Services Ltd.'), 3); ?>
</header>
<main>
<h2><img src="/img/icons/Faenza/mimetypes/32/text-x-source.png" alt="•" /> Software customisation</h2>
@@ -62,10 +47,7 @@
able to lend a hand with other platforms too.</p>
</main>
<footer>
- <hr />
- <p>Spragg Software Services Ltd is registered in England, No. 11248242.
- Registered office: 82 Upper Hanover Street, Sheffield, S3 7RQ.
- VAT reg No. 295343283.</p>
+ <?php echo indent(site_footer(), 3); ?>
</footer>
</body>
</html>