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