Add first-tag colour to blog posts

This commit is contained in:
Talia 2023-09-03 10:54:11 +02:00
parent 52498e1cfa
commit 9b52848707
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -1,9 +1,11 @@
rgbstr = require 'rgbstr'
slots, json = select 1, ... slots, json = select 1, ...
posts = require 'posts' posts = require 'posts'
tags = require 'tags' tags = require 'tags'
post = => post = =>
flexColumn color = table.concat({rgbstr.bytes(@head.tags[1], 16, .3, .5)}, " ")
flexColumn class: "info box", style: "--color: rgb(#{color})"
* h2 a(@head.title, href: @head.uri), style: "view-transition-name: #{@head.slug}" * h2 a(@head.title, href: @head.uri), style: "view-transition-name: #{@head.slug}"
* tags(@head.tags) * tags(@head.tags)
* time is: 'local-date', datetime: @head.date, @head.date * time is: 'local-date', datetime: @head.date, @head.date