Restructure music section, add AOTW

This commit is contained in:
Yarmo Mackenbach 2020-06-12 21:35:47 +02:00
parent 08b54ff328
commit 9109cb2f15
7 changed files with 101 additions and 41 deletions

3
content/music/aotw.yaml Normal file
View File

@ -0,0 +1,3 @@
- year: 1962
artist: Booker T. & the M.G.'s
title: Green Onions

View File

@ -164,6 +164,10 @@ function getVinyl() {
return Yaml::parseFile('content/music/vinyl.yaml');
}
function getAOTW() {
return Yaml::parseFile('content/music/aotw.yaml');
}
function getRSS($params) {
header("Content-Type: text/xml");
$feed = new Feed();

View File

@ -21,7 +21,9 @@ $router->map('GET', '/notes/[*:slug]', function() {}, 'notes_post');
$router->map('GET', '/projects', function() {}, 'projects');
$router->map('GET', '/projects/[*:slug]', function() {}, 'projects_details');
$router->map('GET', '/foss', function() {}, 'foss');
$router->map('GET', '/music', function() {}, 'music');
$router->map('GET', '/vinyl', function() {}, 'vinyl');
$router->map('GET', '/aotw', function() {}, 'aotw');
$router->map('GET', '/pgp', function() {}, 'pgp');
$router->map('GET', '/contact', function() {}, 'contact');
@ -134,6 +136,12 @@ if ($match['name'] == 'vinyl') {
$variables['title'] = 'Vinyl — Yarmo Mackenbach';
}
// If we are dealing with Albu m Of The Week
if ($match['name'] == 'aotw') {
$variables['albums'] = getAOTW();
$variables['title'] = 'Album Of The Week — Yarmo Mackenbach';
}
// If we are dealing with the pgp page
if ($match['name'] == 'pgp') {
$variables['title'] = 'PGP — Yarmo Mackenbach';
@ -198,10 +206,18 @@ if ($environment === 'production') {
\Phug\Optimizer::call('displayFile', ['foss', $variables], $options);
break;
case 'music':
\Phug\Optimizer::call('displayFile', ['music', $variables], $options);
break;
case 'vinyl':
\Phug\Optimizer::call('displayFile', ['vinyl', $variables], $options);
break;
case 'aotw':
\Phug\Optimizer::call('displayFile', ['aotw', $variables], $options);
break;
case 'contact':
\Phug\Optimizer::call('displayFile', ['contact', $variables], $options);
break;
@ -266,10 +282,18 @@ if(is_array($match) && is_callable($match['target'])) {
Phug::displayFile('foss', $variables, $options);
break;
case 'music':
Phug::displayFile('music', $variables, $options);
break;
case 'vinyl':
Phug::displayFile('vinyl', $variables, $options);
break;
case 'aotw':
Phug::displayFile('aotw', $variables, $options);
break;
case 'contact':
Phug::displayFile('contact', $variables, $options);
break;

14
views/aotw.pug Normal file
View File

@ -0,0 +1,14 @@
extends layout
mixin entry($item)
.list__item
p !{$item['artist']} - !{$item['title']} (!{$item['year']})
block content
p
| Back to:
a(href="/") yarmo.eu
h1 Yarmo's Album Of The Week
.list
each $item in $albums
+entry($item)

View File

@ -29,7 +29,7 @@ block content
| |
a(href="/projects") projects
| |
a(href="/vinyl") vinyl
a(href="/music") music
| |
a(href="/pgp") PGP
| |
@ -165,39 +165,6 @@ block content
a(href="/foss") FOSS
h2 >> Music
h3 Instruments
ul
li Piano / keyboards
li Organs
li Synths
h3 Releases
.wrapper-table
table.music
thead
tr
th Years
th Band
th Title
tbody
tr
td 2013
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/979132997") Sir Jupiter
tr
td 2015
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1041392608") EP Roots
tr
td 2016
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1151887625") EP Wings
tr
td 2018
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1454734101") EP Covered In Snow
p
| Go to:
a(href="/music") music

48
views/music.pug Normal file
View File

@ -0,0 +1,48 @@
extends layout
block content
p
| Back to:
a(href="/") yarmo.eu
h1 Yarmo's music
p
| Go to:
a(href="/vinyl") vinyl
| |
a(href="/aotw") Album Of The Week
h3 Instruments
ul
li Piano / keyboards
li Organs
li Synths
h3 Releases
.wrapper-table
table.music
thead
tr
th Years
th Band
th Title
tbody
tr
td 2013
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/979132997") Sir Jupiter
tr
td 2015
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1041392608") EP Roots
tr
td 2016
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1151887625") EP Wings
tr
td 2018
td Sir Jupiter
td
a(href="https://song.link/album/nl/i/1454734101") EP Covered In Snow

View File

@ -1,7 +1,7 @@
extends layout
mixin vinyl_album($item)
.vinyl_list__item
mixin entry($item)
.list__item
p !{$item['artist']} - !{$item['title']} (!{$item['year']})
block content
@ -9,6 +9,6 @@ block content
| Back to:
a(href="/") yarmo.eu
h1 Yarmo's vinyl collection
.vinyl_list
.list
each $item in $albums
+vinyl_album($item)
+entry($item)