🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-01-22 11:43:07 +08:00
parent 235c556f3d
commit fd289d980e
9 changed files with 16 additions and 18 deletions

BIN
dist.zip Normal file

Binary file not shown.

View File

@ -1,8 +1,10 @@
--- ---
import RootLayout from "./RootLayout.astro"; import RootLayout from "./RootLayout.astro";
const { title } = Astro.props;
--- ---
<RootLayout> <RootLayout title={title}>
<main class="container mx-auto h-fullpage mt-header"> <main class="container mx-auto h-fullpage mt-header">
<slot /> <slot />
</main> </main>

View File

@ -13,7 +13,8 @@ const { title } = Astro.props;
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<title>{title}</title> {title && (<title>山羊寒舍 | {title}</title>)}
{!title && (<title>山羊寒舍</title>)}
<ViewTransitions /> <ViewTransitions />
</head> </head>

View File

@ -45,7 +45,7 @@ const { posts } = (
).data; ).data;
--- ---
<PageLayout> <PageLayout title="分类检索">
<div class="max-w-[720px] mx-auto"> <div class="max-w-[720px] mx-auto">
<div class="pt-16 pb-6 px-6"> <div class="pt-16 pb-6 px-6">
<h1 class="text-4xl font-bold">分类检索</h1> <h1 class="text-4xl font-bold">分类检索</h1>

View File

@ -30,7 +30,7 @@ const { events } = (
).data; ).data;
--- ---
<PageLayout> <PageLayout title="活动">
<div class="max-w-[720px] mx-auto"> <div class="max-w-[720px] mx-auto">
<div class="card w-full shadow-xl"> <div class="card w-full shadow-xl">
<div class="card-body"> <div class="card-body">

View File

@ -13,8 +13,8 @@ const { slug } = Astro.params;
const { post } = ( const { post } = (
await graphQuery( await graphQuery(
`query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) { `query Query($where: PostWhereUniqueInput!) {
posts(where: $where, orderBy: $orderBy) { post(where: $where) {
slug slug
type type
title title
@ -44,22 +44,17 @@ const { post } = (
} }
}`, }`,
{ {
orderBy: [
{
createdAt: "desc",
},
],
where: { slug }, where: { slug },
} }
) )
).data; ).data;
--- ---
<PageLayout> <PageLayout title={post.title}>
<div class="wrapper"> <div class="wrapper">
<div class="card w-full shadow-xl"> <div class="card w-full shadow-xl">
{ {
post.cover != null && ( post.cover && (
<figure> <figure>
<img src={post.cover.image.url} alt={post.title} /> <img src={post.cover.image.url} alt={post.title} />
</figure> </figure>

View File

@ -36,7 +36,7 @@ const { posts } = (
).data; ).data;
--- ---
<PageLayout> <PageLayout title="记录">
<div class="max-w-[720px] mx-auto"> <div class="max-w-[720px] mx-auto">
<div class="pt-16 pb-6 px-6"> <div class="pt-16 pb-6 px-6">
<h1 class="text-4xl font-bold">记录</h1> <h1 class="text-4xl font-bold">记录</h1>

View File

@ -2,7 +2,7 @@
import PageLayout from "../../layouts/PageLayout.astro"; import PageLayout from "../../layouts/PageLayout.astro";
--- ---
<PageLayout> <PageLayout title="企划">
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View File

@ -45,7 +45,7 @@ const { posts } = (
).data; ).data;
--- ---
<PageLayout> <PageLayout title="标签检索">
<div class="max-w-[720px] mx-auto"> <div class="max-w-[720px] mx-auto">
<div class="pt-16 pb-6 px-6"> <div class="pt-16 pb-6 px-6">
<h1 class="text-4xl font-bold">标签检索</h1> <h1 class="text-4xl font-bold">标签检索</h1>