Browse Source

Improve menu

main
Yarmo Mackenbach 7 months ago
parent
commit
45f2f8f336
  1. 32
      routes/main.js
  2. 26
      views/about.pug
  3. 40
      views/blog.pug
  4. 9
      views/blogroll.pug
  5. 9
      views/contact.pug
  6. 14
      views/feeds.pug
  7. 7
      views/foss.pug
  8. 11
      views/music.pug
  9. 18
      views/notes.pug
  10. 9
      views/now.pug
  11. 36
      views/partials/nav.pug
  12. 9
      views/pgp.pug
  13. 10
      views/post.pug
  14. 6
      views/projects.pug
  15. 7
      views/projects_details.pug
  16. 5
      views/reply.pug
  17. 9
      views/uses.pug
  18. 10
      views/vinyl.pug
  19. 26
      views/work.pug

32
routes/main.js

@ -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

26
views/about.pug

@ -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

40
views/blog.pug

@ -9,35 +9,13 @@ 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
main
div(style="display:none")
include id
.longform_list.h-feed
each item in blogPosts
+entry(item)
div(style="display:none")
include id
.longform_list.h-feed
each item in blogPosts
+entry(item)

9
views/blogroll.pug

@ -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

9
views/contact.pug

@ -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

14
views/feeds.pug

@ -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

7
views/foss.pug

@ -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

11
views/music.pug

@ -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

18
views/notes.pug

@ -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

9
views/now.pug

@ -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

@ -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"

9
views/pgp.pug

@ -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

10
views/post.pug

@ -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

6
views/projects.pug

@ -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

7
views/projects_details.pug

@ -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

5
views/reply.pug

@ -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

9
views/uses.pug

@ -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

10
views/vinyl.pug

@ -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

26
views/work.pug

@ -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

Loading…
Cancel
Save