This commit is contained in:
parent
862c70be2c
commit
ee4cc77c85
44
index.php
44
index.php
@ -35,6 +35,7 @@ $router->map('GET', '/contact', function() {}, 'contact');
|
|||||||
$match = $router->match();
|
$match = $router->match();
|
||||||
|
|
||||||
// Template engine settings and variables
|
// Template engine settings and variables
|
||||||
|
$basetitle = 'yarmo';
|
||||||
$environment = getenv('ENVIRONMENT') ?: 'production';
|
$environment = getenv('ENVIRONMENT') ?: 'production';
|
||||||
$options = [
|
$options = [
|
||||||
'paths' => [
|
'paths' => [
|
||||||
@ -50,13 +51,13 @@ $options = [
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
$variables = [
|
$variables = [
|
||||||
'title' => 'Yarmo Mackenbach'
|
'title' => $basetitle
|
||||||
];
|
];
|
||||||
|
|
||||||
// If we are dealing with the home page
|
// If we are dealing with the home page
|
||||||
if ($match['name'] == 'home') {
|
if ($match['name'] == 'home') {
|
||||||
$variables['posts'] = getBlogPosts($variables['params']);
|
$variables['posts'] = getBlogPosts($variables['params']);
|
||||||
$variables['title'] = 'Blog — Yarmo Mackenbach';
|
$variables['title'] = 'Blog — '.$basetitle;
|
||||||
// $variables['icons'] = getIcons();
|
// $variables['icons'] = getIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,18 +94,23 @@ if ($match['name'] == 'rss-notes') {
|
|||||||
|
|
||||||
// If we are dealing with the feeds
|
// If we are dealing with the feeds
|
||||||
if ($match['name'] == 'feeds') {
|
if ($match['name'] == 'feeds') {
|
||||||
$variables['title'] = 'Feeds — Yarmo Mackenbach';
|
$variables['title'] = 'Feeds — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the uses
|
// If we are dealing with the uses
|
||||||
if ($match['name'] == 'uses') {
|
if ($match['name'] == 'uses') {
|
||||||
$variables['title'] = 'Uses — Yarmo Mackenbach';
|
$variables['title'] = 'Uses — '.$basetitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we are dealing with the now
|
||||||
|
if ($match['name'] == 'now') {
|
||||||
|
$variables['title'] = 'Now — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the blog
|
// If we are dealing with the blog
|
||||||
if ($match['name'] == 'blog') {
|
if ($match['name'] == 'blog') {
|
||||||
$variables['posts'] = getBlogPosts($variables['params']);
|
$variables['posts'] = getBlogPosts($variables['params']);
|
||||||
$variables['title'] = 'Blog — Yarmo Mackenbach';
|
$variables['title'] = 'Blog — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with a blog post
|
// If we are dealing with a blog post
|
||||||
@ -112,13 +118,13 @@ if ($match['name'] == 'blog_post') {
|
|||||||
$variables['params']['slug'] = $match['params']['slug'];
|
$variables['params']['slug'] = $match['params']['slug'];
|
||||||
$variables['post'] = getBlogPosts($variables['params']);
|
$variables['post'] = getBlogPosts($variables['params']);
|
||||||
$variables['post'] = $variables['post'][0];
|
$variables['post'] = $variables['post'][0];
|
||||||
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['post']['title'])).' — Yarmo Mackenbach';
|
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['post']['title'])).' — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the notes
|
// If we are dealing with the notes
|
||||||
if ($match['name'] == 'notes') {
|
if ($match['name'] == 'notes') {
|
||||||
$variables['posts'] = getNotes($variables['params']);
|
$variables['posts'] = getNotes($variables['params']);
|
||||||
$variables['title'] = 'Notes — Yarmo Mackenbach';
|
$variables['title'] = 'Notes — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with a notes post
|
// If we are dealing with a notes post
|
||||||
@ -126,13 +132,13 @@ if ($match['name'] == 'notes_post') {
|
|||||||
$variables['params']['slug'] = $match['params']['slug'];
|
$variables['params']['slug'] = $match['params']['slug'];
|
||||||
$variables['post'] = getNotes($variables['params']);
|
$variables['post'] = getNotes($variables['params']);
|
||||||
$variables['post'] = $variables['post'][0];
|
$variables['post'] = $variables['post'][0];
|
||||||
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['post']['title'])).' — Yarmo Mackenbach';
|
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['post']['title'])).' — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the projects
|
// If we are dealing with the projects
|
||||||
if ($match['name'] == 'projects') {
|
if ($match['name'] == 'projects') {
|
||||||
$variables['projects'] = getProjects($variables['params']);
|
$variables['projects'] = getProjects($variables['params']);
|
||||||
$variables['title'] = 'Projects — Yarmo Mackenbach';
|
$variables['title'] = 'Projects — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with a project's details
|
// If we are dealing with a project's details
|
||||||
@ -140,36 +146,36 @@ if ($match['name'] == 'projects_details') {
|
|||||||
$variables['params']['slug'] = $match['params']['slug'];
|
$variables['params']['slug'] = $match['params']['slug'];
|
||||||
$variables['project'] = getProjects($variables['params']);
|
$variables['project'] = getProjects($variables['params']);
|
||||||
$variables['project'] = $variables['project'][0];
|
$variables['project'] = $variables['project'][0];
|
||||||
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['project']['title'])).' — Yarmo Mackenbach';
|
$variables['title'] = htmlspecialchars_decode(str_replace('·','·',$variables['project']['title'])).' — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with foss
|
// If we are dealing with foss
|
||||||
if ($match['name'] == 'foss') {
|
if ($match['name'] == 'foss') {
|
||||||
$variables['foss'] = getFOSS();
|
$variables['foss'] = getFOSS();
|
||||||
$variables['title'] = 'FOSS — Yarmo Mackenbach';
|
$variables['title'] = 'FOSS — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with vinyl
|
// If we are dealing with vinyl
|
||||||
if ($match['name'] == 'vinyl') {
|
if ($match['name'] == 'vinyl') {
|
||||||
$variables['vinyl'] = getVinyl();
|
$variables['vinyl'] = getVinyl();
|
||||||
$variables['albums'] = $variables['vinyl']['albums'];
|
$variables['albums'] = $variables['vinyl']['albums'];
|
||||||
$variables['title'] = 'Vinyl — Yarmo Mackenbach';
|
$variables['title'] = 'Vinyl — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with Albu m Of The Week
|
// If we are dealing with Albu m Of The Week
|
||||||
if ($match['name'] == 'aotw') {
|
if ($match['name'] == 'aotw') {
|
||||||
$variables['albums'] = getAOTW();
|
$variables['albums'] = getAOTW();
|
||||||
$variables['title'] = 'Album Of The Week — Yarmo Mackenbach';
|
$variables['title'] = 'Album Of The Week — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the pgp page
|
// If we are dealing with the pgp page
|
||||||
if ($match['name'] == 'pgp') {
|
if ($match['name'] == 'pgp') {
|
||||||
$variables['title'] = 'PGP — Yarmo Mackenbach';
|
$variables['title'] = 'PGP — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are dealing with the contact page
|
// If we are dealing with the contact page
|
||||||
if ($match['name'] == 'contact') {
|
if ($match['name'] == 'contact') {
|
||||||
$variables['title'] = 'Contact me — Yarmo Mackenbach';
|
$variables['title'] = 'Contact me — '.$basetitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Phug dyninclude
|
// Add Phug dyninclude
|
||||||
@ -212,6 +218,10 @@ if ($environment === 'production') {
|
|||||||
\Phug\Optimizer::call('displayFile', ['uses', $variables], $options);
|
\Phug\Optimizer::call('displayFile', ['uses', $variables], $options);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'now':
|
||||||
|
\Phug\Optimizer::call('displayFile', ['now', $variables], $options);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'blog':
|
case 'blog':
|
||||||
\Phug\Optimizer::call('displayFile', ['blog', $variables], $options);
|
\Phug\Optimizer::call('displayFile', ['blog', $variables], $options);
|
||||||
break;
|
break;
|
||||||
@ -295,11 +305,13 @@ if(is_array($match) && is_callable($match['target'])) {
|
|||||||
case 'feeds':
|
case 'feeds':
|
||||||
Phug::displayFile('feeds', $variables, $options);
|
Phug::displayFile('feeds', $variables, $options);
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case 'uses':
|
case 'uses':
|
||||||
Phug::displayFile('uses', $variables, $options);
|
Phug::displayFile('uses', $variables, $options);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'now':
|
||||||
|
Phug::displayFile('now', $variables, $options);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'blog':
|
case 'blog':
|
||||||
|
|||||||
@ -8,6 +8,8 @@ block content
|
|||||||
| About Me
|
| About Me
|
||||||
nav
|
nav
|
||||||
| Go to:
|
| Go to:
|
||||||
|
a(href="/now") now
|
||||||
|
| |
|
||||||
a(href="/") blog
|
a(href="/") blog
|
||||||
| |
|
| |
|
||||||
a(href="/notes") notes
|
a(href="/notes") notes
|
||||||
|
|||||||
23
views/now.pug
Normal file
23
views/now.pug
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
header
|
||||||
|
nav
|
||||||
|
a(href="/about") about me
|
||||||
|
| > now
|
||||||
|
h1
|
||||||
|
| Now
|
||||||
|
|
||||||
|
main
|
||||||
|
h3 Working on
|
||||||
|
ul
|
||||||
|
li recovering from the PhD
|
||||||
|
li finishing a scientific publication
|
||||||
|
li numerous FOSS projects
|
||||||
|
li the search for employment in a whole different field
|
||||||
|
li new music
|
||||||
|
|
||||||
|
h3 Enjoying
|
||||||
|
ul
|
||||||
|
li renovating rooms in my house
|
||||||
|
li becoming a modular synth daddy
|
||||||
Loading…
x
Reference in New Issue
Block a user