diff --git a/javascript/BlogPost.js b/javascript/BlogPost.js deleted file mode 100644 index 50c87db..0000000 --- a/javascript/BlogPost.js +++ /dev/null @@ -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"]})) - ) - } -}) diff --git a/pages/index.html.skooma.yue b/pages/index.html.skooma.yue index 6602667..4394ac4 100644 --- a/pages/index.html.skooma.yue +++ b/pages/index.html.skooma.yue @@ -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" diff --git a/templates/main.html.skooma.yue b/templates/main.html.skooma.yue index 2019bc3..2156146 100644 --- a/templates/main.html.skooma.yue +++ b/templates/main.html.skooma.yue @@ -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