From 9116e28c2e9ccc9ebfe06960d9617243615c2300 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Tue, 23 Jan 2024 16:17:23 -0800 Subject: [PATCH] setup --- .../astro-ghostcms-theme-default/index.ts | 2 +- .../astro-ghostcms-theme-default/package.json | 10 +- .../src/components/AuthorList.astro | 4 +- .../src/components/BaseHead.astro | 77 ++++ .../src/components/Footer.astro | 4 +- .../src/components/Header.astro | 7 +- .../src/components/MainLayout.astro | 4 +- .../src/components/Page.astro | 6 +- .../src/components/Post.astro | 10 +- .../src/components/PostFooter.astro | 16 +- .../src/components/PostHero.astro | 12 +- .../src/components/PostPreview.astro | 14 +- .../src/components/PostPreviewList.astro | 8 +- .../src/layouts/default.astro | 86 +---- .../src/routes/[slug].astro | 4 +- .../src/routes/archives/[...page].astro | 17 +- .../src/routes/author/[slug].astro | 19 +- .../{authors.astro => authors/index.astro} | 6 +- .../src/routes/index.astro | 11 +- .../src/routes/tag/[slug].astro | 12 +- .../routes/{tags.astro => tags/index.astro} | 10 +- .../src/styles/reset.scss | 2 + .../src/utils/index.ts | 2 +- packages/astro-ghostcms/package.json | 26 +- .../src/api/content-api/index.ts | 3 + packages/astro-ghostcms/src/api/index.ts | 5 +- .../astro-ghostcms/src/api_old/functions.ts | 81 ----- packages/astro-ghostcms/src/api_old/index.ts | 22 -- .../src/api_old/tryghost-content-api.d.ts | 253 ------------- .../src/api_old/tryghost-content-api.js | 294 --------------- pnpm-lock.yaml | 341 +++--------------- 31 files changed, 249 insertions(+), 1119 deletions(-) create mode 100644 packages/astro-ghostcms-theme-default/src/components/BaseHead.astro rename packages/astro-ghostcms-theme-default/src/routes/{authors.astro => authors/index.astro} (86%) rename packages/astro-ghostcms-theme-default/src/routes/{tags.astro => tags/index.astro} (79%) delete mode 100644 packages/astro-ghostcms/src/api_old/functions.ts delete mode 100644 packages/astro-ghostcms/src/api_old/index.ts delete mode 100644 packages/astro-ghostcms/src/api_old/tryghost-content-api.d.ts delete mode 100644 packages/astro-ghostcms/src/api_old/tryghost-content-api.js diff --git a/packages/astro-ghostcms-theme-default/index.ts b/packages/astro-ghostcms-theme-default/index.ts index f506762c..11cc64ca 100644 --- a/packages/astro-ghostcms-theme-default/index.ts +++ b/packages/astro-ghostcms-theme-default/index.ts @@ -1 +1 @@ -export * as Utils from './src/utils' \ No newline at end of file +export * as Utils from './src/utils'; \ No newline at end of file diff --git a/packages/astro-ghostcms-theme-default/package.json b/packages/astro-ghostcms-theme-default/package.json index 38ef1dda..ef3e7d79 100644 --- a/packages/astro-ghostcms-theme-default/package.json +++ b/packages/astro-ghostcms-theme-default/package.json @@ -41,8 +41,16 @@ "./archives/[...page].astro": "./src/routes/archives/[...page].astro" }, "scripts": { }, + "devDependencies": { + "@matthiesenxyz/astro-ghostcms": "*", + "@astrojs/check": "^0.4.1", + "typescript": "^5.3.3" + }, + "peerDependencies": { + "astro": "^4.2.1" + }, "dependencies": { - "@matthiesenxyz/astro-ghostcms": "^2.1.8", + "@matthiesenxyz/astro-ghostcms": "^3.0.0", "tiny-invariant": "^1.3.1", "astro-font": "^0.0.77" } diff --git a/packages/astro-ghostcms-theme-default/src/components/AuthorList.astro b/packages/astro-ghostcms-theme-default/src/components/AuthorList.astro index 94cce34f..150a68ef 100644 --- a/packages/astro-ghostcms-theme-default/src/components/AuthorList.astro +++ b/packages/astro-ghostcms-theme-default/src/components/AuthorList.astro @@ -1,8 +1,8 @@ --- import { getGhostImgPath } from "../utils"; -import type { Settings, PostOrPage } from "@matthiesenxyz/astro-ghostcms/api"; +import type { Settings, Post } from "@matthiesenxyz/astro-ghostcms/api"; export type Props = { - post: PostOrPage; + post: Post; settings: Settings; }; const { post, settings } = Astro.props as Props; diff --git a/packages/astro-ghostcms-theme-default/src/components/BaseHead.astro b/packages/astro-ghostcms-theme-default/src/components/BaseHead.astro new file mode 100644 index 00000000..a699fbe2 --- /dev/null +++ b/packages/astro-ghostcms-theme-default/src/components/BaseHead.astro @@ -0,0 +1,77 @@ +--- +import type { Settings } from "@matthiesenxyz/astro-ghostcms/api"; +import { ViewTransitions } from 'astro:transitions'; + +export type Props = { + title: string; + description: string; + permalink?: string; + image?: string; + settings: Settings; +}; + +const { description, permalink, image, settings, title } = Astro.props as Props; +--- + + + + + + + +{title} + + +{description && } + + + + + + + + + + + + + +{permalink && } +{description && } +{image && } + + + + +{permalink && } +{description && } +{image && } + + + + + + diff --git a/packages/astro-ghostcms-theme-default/src/components/Footer.astro b/packages/astro-ghostcms-theme-default/src/components/Footer.astro index bcaeadee..84a8bd60 100644 --- a/packages/astro-ghostcms-theme-default/src/components/Footer.astro +++ b/packages/astro-ghostcms-theme-default/src/components/Footer.astro @@ -9,10 +9,10 @@ const { settings } = Astro.props as Props;