feat: update some shit
This commit is contained in:
@ -4,7 +4,7 @@ import { CSS, KATEX_CSS } from "https://deno.land/x/gfm@0.2.5/mod.ts";
|
||||
import { Head, Partial } from "$fresh/runtime.ts";
|
||||
import { Emoji } from "@components/Emoji.tsx";
|
||||
|
||||
export default function MyLayout({ Component, url }: LayoutProps) {
|
||||
export default function MyLayout({ Component }: LayoutProps) {
|
||||
return (
|
||||
<div
|
||||
class="md:grid mx-auto"
|
||||
@ -20,7 +20,7 @@ export default function MyLayout({ Component, url }: LayoutProps) {
|
||||
return (
|
||||
<a
|
||||
href={m.link}
|
||||
class={`flex items-center gap-2 text-white [data-ancestor]:bg-white [data-ancestor]:text-black p-3 text-xl w-full rounded-2xl`}
|
||||
class={`flex items-center gap-2 text-white [data-current]:bg-white [data-current]:text-black p-3 text-xl w-full rounded-2xl`}
|
||||
>
|
||||
{<Emoji class="w-6 h-6" name={m.emoji} />} {m.name}
|
||||
</a>
|
||||
|
@ -1,15 +1,16 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import { Article, getArticle } from "@lib/resource/articles.ts";
|
||||
import { RecipeHero } from "@components/RecipeHero.tsx";
|
||||
import { KMenu } from "@islands/KMenu.tsx";
|
||||
import { YoutubePlayer } from "@components/Youtube.tsx";
|
||||
import { HashTags } from "@components/HashTags.tsx";
|
||||
import { isYoutubeLink } from "@lib/string.ts";
|
||||
import { renderMarkdown } from "@lib/documents.ts";
|
||||
import { RedirectSearchHandler } from "@islands/Search.tsx";
|
||||
import PageHero from "@components/PageHero.tsx";
|
||||
import { Star } from "@components/Stars.tsx";
|
||||
|
||||
export const handler: Handlers<Article | null> = {
|
||||
export const handler: Handlers<{ article: Article; session: unknown }> = {
|
||||
async GET(_, ctx) {
|
||||
const article = await getArticle(ctx.params.name);
|
||||
return ctx.render({ article, session: ctx.state.session });
|
||||
@ -33,20 +34,33 @@ export default function Greet(
|
||||
>
|
||||
<RedirectSearchHandler />
|
||||
<KMenu type="main" context={{ type: "article" }} />
|
||||
<RecipeHero
|
||||
data={article}
|
||||
subline={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
editLink={session
|
||||
? `https://notes.max-richter.dev/Media/articles/${article.id}`
|
||||
: ""}
|
||||
backlink="/articles"
|
||||
/>
|
||||
|
||||
<PageHero image={article.meta.image} thumbnail={article.meta.thumbnail}>
|
||||
<PageHero.Header>
|
||||
<PageHero.BackLink href="/articles" />
|
||||
{session && (
|
||||
<PageHero.EditLink
|
||||
href={`https://notes.max-richter.dev/Media/articles/${article.id}`}
|
||||
/>
|
||||
)}
|
||||
</PageHero.Header>
|
||||
<PageHero.Footer>
|
||||
<PageHero.Title link={article.meta.link}>
|
||||
{article.name}
|
||||
</PageHero.Title>
|
||||
<PageHero.Subline
|
||||
entries={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
>
|
||||
{article.meta.rating && <Star rating={article.meta.rating} />}
|
||||
</PageHero.Subline>
|
||||
</PageHero.Footer>
|
||||
</PageHero>
|
||||
{article.tags.length > 0 && (
|
||||
<>
|
||||
<br />
|
||||
|
@ -1,12 +1,13 @@
|
||||
import { Handlers, PageProps, RouteContext } from "$fresh/server.ts";
|
||||
import { PageProps, RouteContext } from "$fresh/server.ts";
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import { getMovie, Movie } from "@lib/resource/movies.ts";
|
||||
import { RecipeHero } from "@components/RecipeHero.tsx";
|
||||
import { HashTags } from "@components/HashTags.tsx";
|
||||
import { renderMarkdown } from "@lib/documents.ts";
|
||||
import { KMenu } from "@islands/KMenu.tsx";
|
||||
import { RedirectSearchHandler } from "@islands/Search.tsx";
|
||||
import { Recommendations } from "@islands/Recommendations.tsx";
|
||||
import PageHero from "@components/PageHero.tsx";
|
||||
import { Star } from "@components/Stars.tsx";
|
||||
|
||||
export default async function Greet(
|
||||
props: PageProps<{ movie: Movie; session: Record<string, string> }>,
|
||||
@ -23,19 +24,33 @@ export default async function Greet(
|
||||
<MainLayout url={props.url} title={`Movie > ${movie.name}`} context={movie}>
|
||||
<RedirectSearchHandler />
|
||||
<KMenu type="main" context={movie} />
|
||||
<RecipeHero
|
||||
data={movie}
|
||||
subline={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
editLink={session
|
||||
? `https://notes.max-richter.dev/Media/movies/${movie.id}`
|
||||
: ""}
|
||||
backlink="/movies"
|
||||
<PageHero image={movie.meta.image} thumbnail={movie.meta.thumbnail}>
|
||||
<PageHero.Header>
|
||||
<PageHero.BackLink href="/movies" />
|
||||
{session && (
|
||||
<PageHero.EditLink
|
||||
href={`https://notes.max-richter.dev/Media/movies/${movie.id}`}
|
||||
/>
|
||||
)}
|
||||
</PageHero.Header>
|
||||
<PageHero.Footer>
|
||||
<PageHero.Title>{movie.name}</PageHero.Title>
|
||||
<PageHero.Subline
|
||||
entries={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
>
|
||||
{movie.meta.rating && <Star rating={movie.meta.rating} />}
|
||||
</PageHero.Subline>
|
||||
</PageHero.Footer>
|
||||
</PageHero>
|
||||
<Recommendations
|
||||
id={movie.id}
|
||||
type="movie"
|
||||
/>
|
||||
{movie.tags.length > 0 && (
|
||||
<>
|
||||
@ -53,8 +68,6 @@ export default async function Greet(
|
||||
>
|
||||
{content}
|
||||
</pre>
|
||||
|
||||
<Recommendations id={movie.id} type="movie"></Recommendations>
|
||||
</div>
|
||||
</MainLayout>
|
||||
);
|
||||
|
@ -1,14 +1,15 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { IngredientsList } from "@islands/IngredientsList.tsx";
|
||||
import { RecipeHero } from "@components/RecipeHero.tsx";
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import Counter from "@islands/Counter.tsx";
|
||||
import { useSignal } from "@preact/signals";
|
||||
import { getRecipe, Recipe } from "@lib/resource/recipes.ts";
|
||||
import { RedirectSearchHandler } from "@islands/Search.tsx";
|
||||
import { KMenu } from "@islands/KMenu.tsx";
|
||||
import PageHero from "@components/PageHero.tsx";
|
||||
import { Star } from "@components/Stars.tsx";
|
||||
|
||||
export const handler: Handlers<Recipe | null> = {
|
||||
export const handler: Handlers<{ recipe: Recipe; session: unknown } | null> = {
|
||||
async GET(_, ctx) {
|
||||
const recipe = await getRecipe(ctx.params.name);
|
||||
return ctx.render({ recipe, session: ctx.state.session });
|
||||
@ -25,7 +26,7 @@ export default function Greet(
|
||||
|
||||
const subline = [
|
||||
recipe?.meta?.time && `Duration ${recipe.meta.time}`,
|
||||
].filter(Boolean);
|
||||
].filter(Boolean) as string[];
|
||||
|
||||
return (
|
||||
<MainLayout
|
||||
@ -35,14 +36,25 @@ export default function Greet(
|
||||
>
|
||||
<RedirectSearchHandler />
|
||||
<KMenu type="main" context={recipe} />
|
||||
<RecipeHero
|
||||
data={recipe}
|
||||
backlink="/recipes"
|
||||
editLink={session
|
||||
? `https://notes.max-richter.dev/Recipes/${recipe.id}`
|
||||
: ""}
|
||||
subline={subline}
|
||||
/>
|
||||
|
||||
<PageHero image={recipe.meta?.image} thumbnail={recipe.meta?.thumbnail}>
|
||||
<PageHero.Header>
|
||||
<PageHero.BackLink href="/articles" />
|
||||
{session && (
|
||||
<PageHero.EditLink
|
||||
href={`https://notes.max-richter.dev/Recipes/${recipe.id}`}
|
||||
/>
|
||||
)}
|
||||
</PageHero.Header>
|
||||
<PageHero.Footer>
|
||||
<PageHero.Title>{recipe.name}</PageHero.Title>
|
||||
<PageHero.Subline
|
||||
entries={subline}
|
||||
>
|
||||
{recipe.meta?.rating && <Star rating={recipe.meta?.rating} />}
|
||||
</PageHero.Subline>
|
||||
</PageHero.Footer>
|
||||
</PageHero>
|
||||
<div class="px-8 text-white mt-10">
|
||||
<div class="flex items-center gap-8">
|
||||
<h3 class="text-3xl my-5">Ingredients</h3>
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import { RecipeHero } from "@components/RecipeHero.tsx";
|
||||
import { HashTags } from "@components/HashTags.tsx";
|
||||
import { renderMarkdown } from "@lib/documents.ts";
|
||||
import { getSeries, Series } from "@lib/resource/series.ts";
|
||||
import { RedirectSearchHandler } from "@islands/Search.tsx";
|
||||
import { KMenu } from "@islands/KMenu.tsx";
|
||||
import PageHero from "@components/PageHero.tsx";
|
||||
import { Star } from "@components/Stars.tsx";
|
||||
|
||||
export const handler: Handlers<{ serie: Series; session: unknown }> = {
|
||||
async GET(_, ctx) {
|
||||
@ -27,20 +28,31 @@ export default function Greet(
|
||||
<MainLayout url={props.url} title={`Serie > ${serie.name}`} context={serie}>
|
||||
<RedirectSearchHandler />
|
||||
<KMenu type="main" context={serie} />
|
||||
<RecipeHero
|
||||
data={serie}
|
||||
subline={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
editLink={session
|
||||
? `https://notes.max-richter.dev/Media/series/${serie.id}`
|
||||
: ""}
|
||||
backlink="/series"
|
||||
/>
|
||||
|
||||
<PageHero image={serie.meta.image} thumbnail={serie.meta.thumbnail}>
|
||||
<PageHero.Header>
|
||||
<PageHero.BackLink href="/series" />
|
||||
{session && (
|
||||
<PageHero.EditLink
|
||||
href={`https://notes.max-richter.dev/Media/series/${serie.id}`}
|
||||
/>
|
||||
)}
|
||||
</PageHero.Header>
|
||||
<PageHero.Footer>
|
||||
<PageHero.Title>{serie.name}</PageHero.Title>
|
||||
<PageHero.Subline
|
||||
entries={[
|
||||
author && {
|
||||
title: author,
|
||||
href: `/?q=${encodeURIComponent(author)}`,
|
||||
},
|
||||
date.toString(),
|
||||
]}
|
||||
>
|
||||
{serie.meta.rating && <Star rating={serie.meta.rating} />}
|
||||
</PageHero.Subline>
|
||||
</PageHero.Footer>
|
||||
</PageHero>
|
||||
{serie.tags.length > 0 && (
|
||||
<>
|
||||
<br />
|
||||
|
Reference in New Issue
Block a user