feat: trying to add hashes to scripts

This commit is contained in:
Max Richter
2026-01-10 13:03:13 +01:00
parent e65938ecc2
commit e55f787a29
79 changed files with 4209 additions and 720 deletions

View File

@@ -1,4 +1,4 @@
import { Handlers, PageProps } from "$fresh/server.ts";
import { PageProps } from "fresh";
import { MainLayout } from "@components/layouts/main.tsx";
import { HashTags } from "@components/HashTags.tsx";
import { removeImage, renderMarkdown } from "@lib/markdown.ts";
@@ -9,20 +9,22 @@ import { Star } from "@components/Stars.tsx";
import { MetaTags } from "@components/MetaTags.tsx";
import { parseRating } from "@lib/helpers.ts";
import { fetchResource } from "@lib/marka/index.ts";
import { getNameOfResource, ReviewResource } from "@lib/marka/schema.ts";
import { ReviewResource } from "@lib/marka/schema.ts";
import { HttpError } from "fresh";
import { define } from "../../utils.ts";
export const handler: Handlers<{ serie: ReviewResource; session: unknown }> = {
async GET(_, ctx) {
export const handler = define.handlers({
async GET(ctx) {
const serie = await fetchResource<ReviewResource>(
`series/${ctx.params.name}.md`,
);
if (!serie) {
return ctx.renderNotFound();
throw new HttpError(404);
}
return ctx.render({ serie, session: ctx.state.session });
return { data: { serie, session: ctx.state.session } };
},
};
});
export default function Greet(
props: PageProps<{ serie: ReviewResource; session: Record<string, string> }>,