feat: trying to add hashes to scripts
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user