feat: add thumbhashes to images closes #6

This commit is contained in:
2023-08-11 16:13:20 +02:00
parent 6dd8575b15
commit 0acbbd6905
22 changed files with 489 additions and 51 deletions

View File

@@ -4,6 +4,7 @@ import { createCrud } from "@lib/crud.ts";
import { stringify } from "$std/yaml/stringify.ts";
import { extractHashTags, formatDate } from "@lib/string.ts";
import { fixRenderedMarkdown } from "@lib/helpers.ts";
import { getThumbhash } from "@lib/cache/image.ts";
export type Article = {
id: string;
@@ -15,6 +16,7 @@ export type Article = {
status: "finished" | "not-finished";
date: Date;
link: string;
thumbnail?: string;
image?: string;
author?: string;
rating?: number;
@@ -24,6 +26,7 @@ export type Article = {
const crud = createCrud<Article>({
prefix: "Media/articles/",
parse: parseArticle,
hasThumbnails: true,
});
function renderArticle(article: Article) {