feat: add title
This commit is contained in:
parent
469db6525d
commit
a765ce7f74
@ -11,7 +11,7 @@ export type Props = {
|
|||||||
description?: string;
|
description?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MainLayout = ({ children, url }: Props) => {
|
export const MainLayout = ({ children, url, title }: Props) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class="md:grid mx-auto"
|
class="md:grid mx-auto"
|
||||||
@ -20,6 +20,8 @@ export const MainLayout = ({ children, url }: Props) => {
|
|||||||
<Head>
|
<Head>
|
||||||
<style>{CSS}</style>
|
<style>{CSS}</style>
|
||||||
<style>{KATEX_CSS}</style>
|
<style>{KATEX_CSS}</style>
|
||||||
|
{title &&
|
||||||
|
<title>{title}</title>}
|
||||||
</Head>
|
</Head>
|
||||||
<aside class="p-4 hidden md:block">
|
<aside class="p-4 hidden md:block">
|
||||||
<nav class="min-h-fit rounded-3xl p-3 grid gap-3 fixed t-0">
|
<nav class="min-h-fit rounded-3xl p-3 grid gap-3 fixed t-0">
|
||||||
|
@ -22,7 +22,7 @@ export default function Greet(props: PageProps<Article>) {
|
|||||||
console.log({ tags: article.tags });
|
console.log({ tags: article.tags });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainLayout url={props.url}>
|
<MainLayout url={props.url} title={`Article > ${article.name}`}>
|
||||||
<RecipeHero
|
<RecipeHero
|
||||||
data={article}
|
data={article}
|
||||||
subline={[author, date.toString()]}
|
subline={[author, date.toString()]}
|
||||||
|
@ -15,7 +15,7 @@ export const handler: Handlers<Article[] | null> = {
|
|||||||
|
|
||||||
export default function Greet(props: PageProps<Article[] | null>) {
|
export default function Greet(props: PageProps<Article[] | null>) {
|
||||||
return (
|
return (
|
||||||
<MainLayout url={props.url}>
|
<MainLayout url={props.url} title="Articles">
|
||||||
<header class="flex gap-4 items-center mb-5 md:hidden">
|
<header class="flex gap-4 items-center mb-5 md:hidden">
|
||||||
<a
|
<a
|
||||||
class="px-4 ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"
|
class="px-4 ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"
|
||||||
|
@ -20,7 +20,7 @@ export default function Greet(props: PageProps<Movie>) {
|
|||||||
console.log(movie.description);
|
console.log(movie.description);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainLayout url={props.url}>
|
<MainLayout url={props.url} title={`Movie > ${movie.name}`}>
|
||||||
<RecipeHero
|
<RecipeHero
|
||||||
data={movie}
|
data={movie}
|
||||||
subline={[author, date.toString()]}
|
subline={[author, date.toString()]}
|
||||||
|
@ -20,7 +20,7 @@ export default function Greet(props: PageProps<Recipe>) {
|
|||||||
const amount = useSignal(portion || 1);
|
const amount = useSignal(portion || 1);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainLayout url={props.url}>
|
<MainLayout url={props.url} title={`Recipes > ${recipe.name}`}>
|
||||||
<RecipeHero data={recipe} backlink="/recipes" />
|
<RecipeHero data={recipe} backlink="/recipes" />
|
||||||
<div class="px-8 text-white mt-10">
|
<div class="px-8 text-white mt-10">
|
||||||
<div class="flex items-center gap-8">
|
<div class="flex items-center gap-8">
|
||||||
|
@ -14,7 +14,7 @@ export const handler: Handlers<Recipe[] | null> = {
|
|||||||
|
|
||||||
export default function Greet(props: PageProps<Recipe[] | null>) {
|
export default function Greet(props: PageProps<Recipe[] | null>) {
|
||||||
return (
|
return (
|
||||||
<MainLayout url={props.url}>
|
<MainLayout url={props.url} title="Recipes">
|
||||||
<header class="flex gap-4 items-center mb-2 lg:mb-5 md:hidden">
|
<header class="flex gap-4 items-center mb-2 lg:mb-5 md:hidden">
|
||||||
<a
|
<a
|
||||||
class="px-4 lg:ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"
|
class="px-4 lg:ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user