aboutsummaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorFran├žois Kooman <fkooman@tuxed.net>2019-04-23 17:31:22 +0200
committerFran├žois Kooman <fkooman@tuxed.net>2019-04-23 17:31:22 +0200
commit64ea114374fcec4a114e572df26396fbe46dd639 (patch)
treec215736ac4f2fe10d09d33b3e8f3d8fa34c9814b /views
parent8c665d6214602e72f2250e10fb0e89ca27affbaf (diff)
downloadwww.tuxed.net-64ea114374fcec4a114e572df26396fbe46dd639.zip
www.tuxed.net-64ea114374fcec4a114e572df26396fbe46dd639.tar.gz
www.tuxed.net-64ea114374fcec4a114e572df26396fbe46dd639.tar.xz
update site
Diffstat (limited to 'views')
-rw-r--r--views/base.php38
-rw-r--r--views/footer.twig10
-rw-r--r--views/header.twig30
-rw-r--r--views/index.php12
-rw-r--r--views/index.twig18
-rw-r--r--views/page.php5
-rw-r--r--views/page.twig12
-rw-r--r--views/post.php14
-rw-r--r--views/post.twig24
9 files changed, 69 insertions, 94 deletions
diff --git a/views/base.php b/views/base.php
new file mode 100644
index 0000000..427c552
--- /dev/null
+++ b/views/base.php
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <!-- Generated on <?php echo $this->e($generatedOn); ?> -->
+ <meta name="viewport" content="width=device-width; height=device-height; initial-scale=1">
+ <title><?php echo $this->e($blogTitle); ?> - <?php echo $this->e($pageTitle); ?></title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->e($requestRoot); ?>css/bootstrap-reboot.css">
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->e($requestRoot); ?>css/screen.css?timestamp=<?php echo $unixTime; ?>">
+</head>
+<body>
+ <div class="header">
+ <h1><?php echo $this->e($blogTitle); ?></h1>
+ <h2><?php echo $this->e($blogDescription); ?></h2>
+ <ul class="pages">
+<?php foreach ($pagesList as $p): ?>
+<?php if ($p['fileName'] === $activePage): ?>
+ <li class="active">
+ <a href="<?php echo $this->e($requestRoot); ?><?php echo $this->e($p['fileName']); ?>"><?php echo $this->e($p['title']); ?></a>
+ </li>
+<?php else: ?>
+ <li>
+ <a href="<?php echo $this->e($requestRoot); ?><?php echo $this->e($p['fileName']); ?>"><?php echo $this->e($p['title']); ?></a>
+ </li>
+<?php endif; ?>
+<?php endforeach; ?>
+ </ul>
+ </div> <!-- /header -->
+ <div class="content">
+ <?php echo $this->section('content'); ?>
+ </div> <!-- /content -->
+
+ <div class="footer">
+ <p>&copy; <?php echo $this->e($currentYear); ?> <?php echo $this->e($blogAuthor); ?></p>
+ </div> <!-- /footer -->
+</body>
+</html>
diff --git a/views/footer.twig b/views/footer.twig
deleted file mode 100644
index 427ad70..0000000
--- a/views/footer.twig
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="footer">
- <p>&copy; 2018 {{ blogAuthor }}</p>
- <p>
-This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
- </p>
- <p><a href="feed.xml">RSS</a></p>
-</div>
-
-</body>
-</html>
diff --git a/views/header.twig b/views/header.twig
deleted file mode 100644
index fbcbbf7..0000000
--- a/views/header.twig
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{ blogTitle|e }} - {{ pageTitle|e }}</title>
- <link rel="stylesheet" type="text/css" href="{{ toRoot }}css/screen.css">
-</head>
-<body>
-
-<div class="header">
- <h1>{{ blogTitle|e }}</h1>
-
- <ul class="pages">
- {% if 'index.html' == activePage %}
- <li class="active"><a href="{{ toRoot }}index.html">Blog</a></li>
- {% else %}
- <li><a href="{{ toRoot }}index.html">Blog</a></li>
- {% endif %}
-
- {% for p in pagesList %}
- {% if p.fileName == activePage %}
- <li class="active"><a href="{{ toRoot }}{{ p.fileName }}">{{ p.title }}</a></li>
- {% else %}
- <li><a href="{{ toRoot }}{{ p.fileName }}">{{ p.title }}</a></li>
- {% endif %}
- {% endfor %}
- </ul>
-</div>
diff --git a/views/index.php b/views/index.php
new file mode 100644
index 0000000..319f617
--- /dev/null
+++ b/views/index.php
@@ -0,0 +1,12 @@
+<?php foreach ($postsYearList as $year => $postsList): ?>
+<h3><?=$this->e($year); ?></h3>
+ <ul class="index">
+<?php foreach ($postsList as $post): ?>
+<?php if ($post['publish']): ?>
+ <li>
+ <a href="blog/<?php echo $this->e($post['fileName']); ?>"><?php echo $this->e($post['title']); ?></a> <small><?php echo $this->e($post['published']); ?></small>
+ </li>
+<?php endif; ?>
+<?php endforeach; ?>
+ </ul>
+<?php endforeach; ?>
diff --git a/views/index.twig b/views/index.twig
deleted file mode 100644
index ecfc149..0000000
--- a/views/index.twig
+++ /dev/null
@@ -1,18 +0,0 @@
-{% include 'header.twig' %}
-
-<div class="content">
-
- <h2>{{ pageTitle|e }}</h2>
- <ul class="index">
- {% for post in postsList %}
- {% if post.publish %}
- <li>
- <a href="{{ toRoot }}blog/{{post.fileName|e }}">{{ post.title|e }}</a> <small>{{post.published|e }}</small>
- </li>
- {% endif %}
- {% endfor %}
- </ul>
-
-</div> <!-- /content -->
-
-{% include 'footer.twig' %}
diff --git a/views/page.php b/views/page.php
new file mode 100644
index 0000000..c44e3a3
--- /dev/null
+++ b/views/page.php
@@ -0,0 +1,5 @@
+<?php $this->layout('base'); ?>
+<?php $this->start('content'); ?>
+ <h2><?php echo $this->e($pageTitle); ?></h2>
+ <?php echo $pageContent['htmlContent']; ?>
+<?php $this->stop(); ?>
diff --git a/views/page.twig b/views/page.twig
deleted file mode 100644
index f2f9518..0000000
--- a/views/page.twig
+++ /dev/null
@@ -1,12 +0,0 @@
-{% include 'header.twig' %}
-
-<div class="content">
-
- <h2>{{ pageTitle|e }}</h2>
-
- {{ pageContent.htmlContent|raw }}
-
- <p class="center"><small><a href="{{ toRoot}}index.html">Return to Index</a></small></p>
-</div> <!-- /content -->
-
-{% include 'footer.twig' %}
diff --git a/views/post.php b/views/post.php
new file mode 100644
index 0000000..0c554cd
--- /dev/null
+++ b/views/post.php
@@ -0,0 +1,14 @@
+<?php $this->layout('base'); ?>
+<?php $this->start('content'); ?>
+ <h2><?php echo $this->e($pageTitle); ?></h2>
+ <?php echo $post['htmlContent']; ?>
+
+ <p class="center">
+ <small>
+ Published on <?php echo $this->e($post['published']); ?>
+<?php if ($post['modified']): ?>
+ (Updated on <?php echo $this->e($post['modified']); ?>)
+<?php endif; ?>
+ </small>
+ </p>
+<?php $this->stop(); ?>
diff --git a/views/post.twig b/views/post.twig
deleted file mode 100644
index 97247b3..0000000
--- a/views/post.twig
+++ /dev/null
@@ -1,24 +0,0 @@
-{% include 'header.twig' %}
-
-<div class="content">
-
- <h2>{{ pageTitle|e }}</h2>
-
- {% if post.published %}
- <p class="date">
- <small>{{ post.published|e }}</small>
- </p>
- {% endif %}
-
- {{ post.htmlContent|raw }}
-
- {% if post.modified %}
- <p>
- <small>Last updated on {{ post.modified|e }}</small>
- </p>
- {% endif %}
-
- <p class="center"><small><a href="{{ toRoot}}index.html">Return to Index</a></small></p>
-</div> <!-- /content -->
-
-{% include 'footer.twig' %}