Improve menu

This commit is contained in:
Yarmo Mackenbach 2021-03-14 18:53:35 +01:00
parent 23e92ffc3a
commit 45f2f8f336
19 changed files with 77 additions and 216 deletions

View File

@ -7,52 +7,52 @@ const util = require('../server/util')
router.param('slug', mw.getPostBySlug)
router.get('/', mw.getBlogPosts, (req, res) => {
res.render('blog', { title: 'Blog — yarmo.eu' })
res.render('blog', { title: 'Blog — yarmo.eu', nav1: 'blog', nav2: 'posts' })
})
router.get('/blog', mw.getBlogPosts, (req, res) => {
res.render('blog', { title: 'Blog — yarmo.eu' })
res.render('blog', { title: 'Blog — yarmo.eu', nav1: 'blog', nav2: 'posts' })
})
router.get('/blog/:s', (req, res) => {
res.redirect(`/post/${req.params.s}`)
})
router.get('/notes', mw.getNotes, (req, res) => {
res.render('notes', { title: 'Notes — yarmo.eu' })
res.render('notes', { title: 'Notes — yarmo.eu', nav1: 'blog', nav2: 'notes' })
})
router.get('/notes/:s', (req, res) => {
res.redirect(`/post/${req.params.s}`)
})
router.get('/post/:slug', (req, res) => {
res.render('post', { title: `${res.locals.post.title} — yarmo.eu` })
res.render('post', { title: `${res.locals.post.title} — yarmo.eu`, nav1: 'blog', nav2: '' })
})
router.get('/blogroll', (req, res) => {
res.render('blogroll', { title: 'Blogroll — yarmo.eu' })
res.render('blogroll', { title: 'Blogroll — yarmo.eu', nav1: 'blog', nav2: 'blogroll' })
})
router.get('/feeds', (req, res) => {
res.render('feeds', { title: 'Feeds — yarmo.eu' })
res.render('feeds', { title: 'Feeds — yarmo.eu', nav1: 'blog', nav2: 'feeds' })
})
router.get('/about', (req, res) => {
res.render('about', { title: 'About me — yarmo.eu' })
res.render('about', { title: 'About me — yarmo.eu', nav1: 'about', nav2: 'about' })
})
router.get('/work', (req, res) => {
res.render('work', { title: 'Work — yarmo.eu' })
})
router.get('/contact', (req, res) => {
res.render('contact', { title: 'Contact — yarmo.eu' })
res.render('work', { title: 'Work — yarmo.eu', nav1: 'about', nav2: 'work' })
})
router.get('/now', (req, res) => {
res.render('now', { title: 'Now — yarmo.eu' })
res.render('now', { title: 'Now — yarmo.eu', nav1: 'about', nav2: 'now' })
})
router.get('/uses', (req, res) => {
res.render('uses', { title: 'Uses — yarmo.eu' })
res.render('uses', { title: 'Uses — yarmo.eu', nav1: 'about', nav2: 'uses' })
})
router.get('/music', (req, res) => {
res.render('music', { title: 'Music — yarmo.eu' })
res.render('music', { title: 'Music — yarmo.eu', nav1: 'about', nav2: 'music' })
})
router.get('/vinyl', mw.getVinyl, (req, res) => {
res.render('vinyl', { title: 'Vinyl — yarmo.eu' })
res.render('vinyl', { title: 'Vinyl — yarmo.eu', nav1: 'about', nav2: 'music' })
})
router.get('/pgp', (req, res) => {
res.render('pgp', { title: 'PGP — yarmo.eu' })
res.render('pgp', { title: 'PGP — yarmo.eu', nav1: 'about', nav2: 'pgp' })
})
router.get('/contact', (req, res) => {
res.render('contact', { title: 'Contact — yarmo.eu', nav1: 'contact', nav2: '' })
})
module.exports = router

View File

@ -1,31 +1,7 @@
extends templates/main
block content
header
h1
| About Me
nav
| >>
a(href="/about") about me
nav
| Go to:
a(href="/") blog
| |
a(href="/notes") notes
| |
a(href="/feeds") feeds
| |
a(href="/now") now
| |
a(href="/uses") uses
| |
a(href="/work") work
| |
a(href="/music") music
| |
a(href="/pgp") PGP
| |
a(href="/contact") contact
include partials/nav
main

View File

@ -9,29 +9,7 @@ mixin entry(item)
time(datetime=item['date']).dt-published !{item['date_formatted']}
block content
.h-card
header
//nav
a(href="/about") about me
| > blog
h1
| Yarmo's blog
nav
| >>
a(href="/") blog
nav
| Go to:
a(href="/about") about me
| |
a(href="/notes") notes
| |
a(href="/blogroll") blogroll
| |
a(href="/feeds") feeds
| |
a(href="/contact") contact
| |
a(href="https://yarmo.live") live streaming
include partials/nav
main

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| Blogroll
nav
| >>
a(href="/about") about me
| >
a(href="/blogroll") blogroll
include partials/nav
main
a(href="https://ar.al/") Aral Balkan

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| Contact me
nav
| >>
a(href="/about") about me
| >
a(href="/contact") contact
include partials/nav
main
h2 >> Online presence

View File

@ -1,19 +1,7 @@
extends templates/main
block content
header
h1
| Feeds
nav
| >>
a(href="/feeds") feeds
nav
| Go to:
a(href="/about") about me
| |
a(href="/blog") blog
| |
a(href="/notes") notes
include partials/nav
main
ul

View File

@ -9,12 +9,7 @@ mixin foss_contribution($item)
| !{$item['title']}
block content
header
nav
a(href="/about") about me
| > foss
h1
| FOSS
include partials/nav
main
h2 >> VCS accounts

View File

@ -1,16 +1,7 @@
extends templates/main
block content
header
h1 Yarmo's music
nav
| >>
a(href="/about") about me
| >
a(href="/music") music
nav
| Go to:
a(href="/vinyl") vinyl
include partials/nav
main
h3 Instruments

View File

@ -9,23 +9,7 @@ mixin entry(item)
time(datetime=item['date']).dt-published !{item['date_formatted']}
block content
header
//nav
a(href="/about") about me
| > notes
h1 Yarmo's notes
nav
| >>
a(href="/notes") notes
nav
| Go to:
a(href="/about") about me
| |
a(href="/") blog
| |
a(href="/feeds") feeds
| |
a(href="/contact") contact
include partials/nav
main
.longform_list

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| Now
nav
| >>
a(href="/about") about me
| >
a(href="/now") now
include partials/nav
main
h3 Working on

36
views/partials/nav.pug Normal file
View File

@ -0,0 +1,36 @@
header
h1
| yarmo.eu
nav
a(href="/")= nav1=="blog" ? "|BLOG|" : "blog"
| ·
a(href="/about")= nav1=="about" ? "|ABOUT|" : "about"
| ·
a(href="/contact")= nav1=="contact" ? "|CONTACT|" : "contact"
| ·
a(href="https://yarmo.live") live streaming
if nav1 == "blog"
nav
| >>
a(href="/")= nav2=="posts" ? "|POSTS|" : "posts"
| ·
a(href="/notes")= nav2=="notes" ? "|NOTES|" : "notes"
| ·
a(href="/feeds")= nav2=="feeds" ? "|FEEDS|" : "feeds"
| ·
a(href="/blogroll")= nav2=="blogroll" ? "|BLOGROLL|" : "blogroll"
else if nav1 == "about"
nav
| >>
a(href="/about")= nav2=="about" ? "|ABOUT|" : "about"
| ·
a(href="/now")= nav2=="now" ? "|NOW|" : "now"
| ·
a(href="/uses")= nav2=="uses" ? "|USES|" : "uses"
| ·
a(href="/work")= nav2=="work" ? "|WORK|" : "work"
| ·
a(href="/music")= nav2=="music" ? "|MUSIC|" : "music"
| ·
a(href="/pgp")= nav2=="pgp" ? "|PGP|" : "pgp"

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| PGP public key
nav
| >>
a(href="/about") about me
| >
a(href="/pgp") pgp
include partials/nav
main
h3#pgp-fingerprint Fingerprint

View File

@ -35,15 +35,7 @@ mixin discussionLink(item)
a(href=item) !{item}
block content
header
nav
| >>
if post.type == 'blog'
a(href="/") blog
if post.type == 'note'
a(href="/notes") notes
| >
a(href=post.url)= post.slug
include partials/nav
main
article.longform.h-entry

View File

@ -8,11 +8,7 @@ mixin entry($item)
| Status: !{$item['status']}
block content
header
nav
a(href="/about") about me
| > projects
h1 Yarmo's projects
include partials/nav
main
.longform_list

View File

@ -6,12 +6,7 @@ mixin webmention($item)
| by !{$item['author_name']} on !{$item['date']} at !{$item['time']}
block content
header
nav
a(href="/about") about me
| >
a(href="/projects") projects
| > !{$project['slug']}
include partials/nav
main
article.longform

View File

@ -31,10 +31,7 @@ mixin webmention($item)
| at !{$item['time']} UTC
block content
header
nav
a(href="/about") about me
| > !{$reply['slug']}
include partials/nav
main
article.longform.h-entry

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| Uses
nav
| >>
a(href="/about") about me
| >
a(href="/uses") uses
include partials/nav
main
h2 Hardware

View File

@ -5,15 +5,7 @@ mixin entry(item)
p !{item['artist']} - !{item['title']} (!{item['year']})
block content
header
h1 Yarmo's vinyl collection
nav
| >>
a(href="/about") about me
| >
a(href="/music") music
| >
a(href="/vinyl") vinyl
include partials/nav
main
.list

View File

@ -1,14 +1,7 @@
extends templates/main
block content
header
h1
| Work
nav
| >>
a(href="/about") about me
| >
a(href="/work") work
include partials/nav
main
h2 >> Open Source developer
@ -18,20 +11,3 @@ block content
| Currently working on
a(href="https://keyoxide.org") Keyoxide
| .
h3 VCS accounts
.wrapper-table
table
tbody
tr
td Codeberg
td
a(href="https://codeberg.org/yarmo" rel="me") @yarmo
tr
td GitLab
td
a(href="https://gitlab.com/yarmo" rel="me") @yarmo
tr
td Github
td
a(href="https://github.com/YarmoM" rel="me") @YarmoM