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>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user