Remove prefix from URLs

This commit is contained in:
Talia 2023-07-21 23:47:07 +02:00
parent 39766e069e
commit 334534980a
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E
3 changed files with 3 additions and 21 deletions

View file

@ -1,17 +0,0 @@
import element from 'https://cdn.jsdelivr.net/gh/darkwiiplayer/js@3724b3e/element.js'
import {html, empty} from 'https://cdn.jsdelivr.net/gh/darkwiiplayer/js@cdaeac1/skooma.js'
export default element(class BlogPost extends HTMLElement {
static attributes = { name: true }
constructor() {
super()
this.post = posts.find(post => post.head.slug == this.name)
}
async nameChanged() {
this.replace(
html.a({href: `/blog${this.post.head.uri}`}, html.h2(this.post.head.title)),
this.post.head.description ? html.p(this.post.head.description) : undefined,
html.p(html.time$localDate({datetime: this.post.head.date, class: ["timestamp"]}))
)
}
})

View file

@ -1,16 +1,15 @@
import output from require 'params'
slots, json = select 1, ...
posts = require 'posts'
post = =>
a href: "/"..output..@head.uri,
a href: @head.uri,
* flexColumn
* h2 @head.title, style: "view-transition-name: #{@head.slug}"
* time is: 'local-date', datetime: @head.date, @head.date
* @head.description
slots.head title "Index"
slots.head script type: 'module', src: "/#{output}/javascript/LocalDate.js"
slots.head script type: 'module', src: "/javascript/LocalDate.js"
return main
* h1 "Blog Posts"

View file

@ -35,6 +35,6 @@ html
* header class: 'sticky'
* h1 "Talia's Blog"
* nav { class: 'right bar' }
* ul li a "Home", href: "/blog"
* ul li a "Home", href: "/"
* main
* content slots, data