Add blogroll
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Yarmo Mackenbach 2020-07-03 17:10:12 +02:00
parent 637ee02fdc
commit 61f720de6f
3 changed files with 40 additions and 0 deletions

View File

@ -18,6 +18,7 @@ $router->map('GET', '/about', function() {}, 'about');
$router->map('GET', '/feeds', function() {}, 'feeds');
$router->map('GET', '/uses', function() {}, 'uses');
$router->map('GET', '/now', function() {}, 'now');
$router->map('GET', '/blogroll', function() {}, 'blogroll');
$router->map('GET', '/blog', function() {}, 'blog');
$router->map('GET', '/blog/[*:slug]', function() {}, 'blog_post');
$router->map('GET', '/notes', function() {}, 'notes');
@ -109,6 +110,11 @@ if ($match['name'] == 'now') {
$variables['title'] = 'Now — '.$basetitle;
}
// If we are dealing with the blogroll
if ($match['name'] == 'blogroll') {
$variables['title'] = 'Blogroll — '.$basetitle;
}
// If we are dealing with the blog
if ($match['name'] == 'blog') {
$variables['posts'] = getBlogPosts($match['params']);
@ -233,6 +239,10 @@ if ($environment === 'production') {
\Phug\Optimizer::call('displayFile', ['now', $variables], $options);
break;
case 'blogroll':
\Phug\Optimizer::call('displayFile', ['blogroll', $variables], $options);
break;
case 'blog':
\Phug\Optimizer::call('displayFile', ['blog', $variables], $options);
break;
@ -333,6 +343,10 @@ if(is_array($match) && is_callable($match['target'])) {
Phug::displayFile('now', $variables, $options);
break;
case 'blogroll':
Phug::displayFile('blogroll', $variables, $options);
break;
case 'blog':
Phug::displayFile('blog', $variables, $options);
break;

View File

@ -16,6 +16,8 @@ block content
| |
a(href="/feeds") feeds
| |
a(href="/blogroll") blogroll
| |
a(href="/uses") uses
| |
a(href="/foss") FOSS

24
views/blogroll.pug Normal file
View File

@ -0,0 +1,24 @@
extends layout
block content
header
nav
a(href="/about") about me
| > blogroll
h1
| Blogroll
main
a(href="https://ar.al/") Aral Balkan
br
a(href="https://write.privacytools.io/freddy/") Freddy's Ramblings
br
a(href="https://www.garron.blog/posts/") Guillermo Garron
br
a(href="https://goel.io/") Karan Goel
br
a(href="https://kevq.uk/") Kev Quirk
br
a(href="https://mikestone.me/") Mike Stone
br
a(href="https://degruchy.org/") Nathan DeGruchy