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 { KMenu } from "@islands/KMenu.tsx";
|
||||
import { YoutubePlayer } from "@components/Youtube.tsx";
|
||||
@@ -12,19 +12,20 @@ import { MetaTags } from "@components/MetaTags.tsx";
|
||||
import { fetchResource } from "@lib/marka/index.ts";
|
||||
import { ArticleResource } from "@lib/marka/schema.ts";
|
||||
import { parseRating } from "@lib/helpers.ts";
|
||||
import { HttpError } from "fresh";
|
||||
import { define } from "../../utils.ts";
|
||||
|
||||
export const handler: Handlers<{ article: ArticleResource; session: unknown }> =
|
||||
{
|
||||
async GET(_, ctx) {
|
||||
const article = await fetchResource<ArticleResource>(
|
||||
`articles/${ctx.params.name}.md`,
|
||||
);
|
||||
if (!article) {
|
||||
return ctx.renderNotFound();
|
||||
}
|
||||
return ctx.render({ article, session: ctx.state.session });
|
||||
},
|
||||
};
|
||||
export const handler = define.handlers({
|
||||
async GET(ctx) {
|
||||
const article = await fetchResource<ArticleResource>(
|
||||
`articles/${ctx.params.name}.md`,
|
||||
);
|
||||
if (!article) {
|
||||
throw new HttpError(404);
|
||||
}
|
||||
return { data: { article, session: ctx.state.session } };
|
||||
},
|
||||
});
|
||||
|
||||
export default function Greet(
|
||||
props: PageProps<
|
||||
|
||||
Reference in New Issue
Block a user