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,3 @@
import { PageProps, RouteContext } from "$fresh/server.ts";
import { MainLayout } from "@components/layouts/main.tsx";
import { ReviewResource } from "@lib/marka/schema.ts";
import { removeImage, renderMarkdown } from "@lib/markdown.ts";
@@ -10,18 +9,18 @@ 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 { HttpError } from "fresh";
import { define } from "../../utils.ts";
export default async function Greet(
props: PageProps<{ movie: ReviewResource; session: Record<string, string> }>,
ctx: RouteContext,
) {
export default define.page(async function (ctx) {
const props = ctx.req;
const movie = await fetchResource<ReviewResource>(
`movies/${ctx.params.name}.md`,
);
const session = ctx.state.session;
if (!movie) {
return ctx.renderNotFound();
throw new HttpError(404);
}
const { author, datePublished, reviewBody = "", reviewRating } =
@@ -87,4 +86,4 @@ export default async function Greet(
</div>
</MainLayout>
);
}
});

View File

@@ -2,13 +2,13 @@ import { MainLayout } from "@components/layouts/main.tsx";
import { GenericResource, ReviewResource } from "@lib/marka/schema.ts";
import { ResourceCard } from "@components/Card.tsx";
import { Grid } from "@components/Grid.tsx";
import { IconArrowLeft } from "@components/icons.tsx";
import { KMenu } from "@islands/KMenu.tsx";
import { RedirectSearchHandler } from "@islands/Search.tsx";
import { PageProps } from "$fresh/server.ts";
import { PageProps } from "fresh";
import { listResources } from "@lib/marka/index.ts";
import { parseResourceUrl, searchResource } from "@lib/search.ts";
import { parseRating } from "@lib/helpers.ts";
import { TbArrowLeft } from "@preact-icons/tb";
function sortOptional(a: number | string = 0, b: number | string = 0) {
return (parseRating(a) > parseRating(b)) ? 1 : -1;
@@ -44,7 +44,7 @@ export default async function MovieIndex(
class="px-4 ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"
href="/"
>
<IconArrowLeft class="w-5 h-5" />
{TbArrowLeft({ class: "w-5 h-5" })}
Back
</a>