diff --git a/.astro/types.d.ts b/.astro/types.d.ts index 27705ca..6cf2b5b 100644 --- a/.astro/types.d.ts +++ b/.astro/types.d.ts @@ -216,5 +216,5 @@ declare module 'astro:content' { type AnyEntryMap = ContentEntryMap & DataEntryMap; - export type ContentConfig = typeof import("../src/content/config.js"); + export type ContentConfig = typeof import("./../src/content/config.js"); } diff --git a/astro.config.mjs b/astro.config.mjs index 5a267f1..803a5cf 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,4 +10,5 @@ export default defineConfig({ integrations: [mdx(), icon(), tailwind({ applyBaseStyles: false, }), compress()], + site: 'https://story-of-the-eight.vercel.app', }) diff --git a/src/components/SiteMeta.astro b/src/components/SiteMeta.astro index 46cdc68..4c72640 100644 --- a/src/components/SiteMeta.astro +++ b/src/components/SiteMeta.astro @@ -16,7 +16,7 @@ let subtitle = 'Story of The Eight' - + diff --git a/src/layouts/DefaultLayout.astro b/src/layouts/DefaultLayout.astro index 53c784a..7773989 100644 --- a/src/layouts/DefaultLayout.astro +++ b/src/layouts/DefaultLayout.astro @@ -9,7 +9,7 @@ const { title = 'Story of The Eight', description = 'A Collection of stories as told by Samuel C Tyler, concerning the collected lore of The Eight.', url, - image = '/eight-social-preview.png', + image = 'eight-social-preview.png', author = 'Samuel C Tyler', } = Astro.props --- @@ -26,9 +26,7 @@ const { diff --git a/src/pages/posts/[...page].astro b/src/pages/posts/[...page].astro index 4d49362..9323949 100644 --- a/src/pages/posts/[...page].astro +++ b/src/pages/posts/[...page].astro @@ -5,7 +5,7 @@ import { getCollection } from "astro:content"; export async function getStaticPaths({ paginate }) { let data = await getCollection("posts"); - // data = data.sort((postA, postB) => postA.order > postB.order) + data.sort((postA, postB) => postA.data.order < postB.data.order ? -1 : 1) return paginate(data, { pageSize: 9 }) } @@ -34,10 +34,10 @@ const { page } = Astro.props
  • {post} {post?.data?.description} diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 90232ad..94b9f89 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -1,55 +1,55 @@ --- import { getCollection } from 'astro:content'; import DefaultLayout from '../../layouts/DefaultLayout.astro' +import { Breadcrumbs, BreadcrumbsItem } from 'accessible-astro-components' export async function getStaticPaths() { const blogEntries = await getCollection('posts'); return blogEntries.map(entry => ({ - params: { slug: entry.slug }, props: { entry }, + params: { slug: entry.slug }, props: { post: entry }, })); } const { post } = Astro.props; -const { Content } = await entry.render(); +const { Content } = await post.render(); --- - +
    - +
    -

    {post.title}


    -

    By userId: {post.userId}

    +

    {post.data.title}


    +

    By: {post.data.author}

    -

    {post.body}

    +

    - + - \ No newline at end of file diff --git a/src/pages/posts/[post].astro b/src/pages/posts/[post].astro deleted file mode 100644 index 2abbee0..0000000 --- a/src/pages/posts/[post].astro +++ /dev/null @@ -1,58 +0,0 @@ ---- -import DefaultLayout from '../../layouts/DefaultLayout.astro' -import { Breadcrumbs, BreadcrumbsItem } from 'accessible-astro-components' -import { getCollection } from "astro:content"; - -export async function getStaticPaths() { - const data = await getCollection("posts"); - - return data.map((post) => { - return { - params: { post: post?.title?.replaceAll(' ', '-')?.toLowerCase() }, - props: { post }, - } - }) -} - -const { post } = Astro.props ---- - - -
    -
    - - - - - -
    -
    -
    -
    -

    {post.title}


    -

    By userId: {post.userId}

    -
    -
    -
    -
    -

    {post.body}

    -
    -
    -
    - -