dynamic index page, title
authorChristian Weiske <cweiske@cweiske.de>
Wed, 3 Aug 2016 20:06:45 +0000 (22:06 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 3 Aug 2016 20:06:45 +0000 (22:06 +0200)
data/config.php.dist
data/templates/index.htm [new file with mode: 0644]
www/index.htm [deleted file]
www/index.php [new file with mode: 0644]

index 6ed9b62..d1eec0d 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+$title  = 'anoweco';
 $dbdsn  = 'mysql:dbname=FIXME;host=127.0.0.1';
 $dbuser = 'FIXME';
 $dbpass = 'FIXME';
diff --git a/data/templates/index.htm b/data/templates/index.htm
new file mode 100644 (file)
index 0000000..865a989
--- /dev/null
@@ -0,0 +1,14 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>{{title}}</title>
+  <link rel="authorization_endpoint" href="{{baseurl}}auth.php"/>
+  <link rel="token_endpoint" href="{{baseurl}}token.php"/>
+  <link rel="micropub" href="{{baseurl}}micropub.php"/>
+ </head>
+ <body>
+  <h1>{{title}}</h1>
+  <p>
+   Anonymous web comments for the indieweb.
+  </p>
+ </body>
+</html>
diff --git a/www/index.htm b/www/index.htm
deleted file mode 100644 (file)
index 1a96ade..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
- <head>
-  <title>anoweco</title>
-  <link rel="authorization_endpoint" href="http://anoweco.bogo/auth.php"/>
-  <link rel="token_endpoint" href="http://anoweco.bogo/token.php"/>
-  <link rel="micropub" href="http://anoweco.bogo/micropub.php"/>
- </head>
- <body>
-  <h1>anoweco</h1>
-  <p>
-   Anonymous web comments.
-  </p>
- </body>
-</html>
diff --git a/www/index.php b/www/index.php
new file mode 100644 (file)
index 0000000..2b6ab74
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+namespace anoweco;
+require 'www-header.php';
+
+require __DIR__ . '/../data/config.php';
+render(
+    'index',
+    array(
+        'title'   => $title,
+        'baseurl' => Urls::full('/'),
+    )
+);
+?>
\ No newline at end of file