From c6b18e5bba59b3f2b325ad763f4a622aa3b1d8a7 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Tue, 23 Jan 2024 20:28:48 -0800 Subject: [PATCH] up --- www/src/content/docs/docs/index.md | 2 +- .../docs/docs/introduction/api/usage.md | 29 ++++++++++++++++++- .../docs/docs/introduction/getting-started.md | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/www/src/content/docs/docs/index.md b/www/src/content/docs/docs/index.md index 0b78d88f..bd4a3098 100644 --- a/www/src/content/docs/docs/index.md +++ b/www/src/content/docs/docs/index.md @@ -4,7 +4,7 @@ description: Learn more about Astro-GhostCMS - Docs built on Starlight --- Demo site status: -![Vercel](https://vercelbadge.vercel.app/api/matthiesenxyz/astro-ghostcms-demo) +![Vercel](https://vercelbadge.vercel.app/api/matthiesenxyz/astro-ghostcms) Welcome to the Astro-GhostCMS Docs! Powered by Starlight & Astro.build! diff --git a/www/src/content/docs/docs/introduction/api/usage.md b/www/src/content/docs/docs/introduction/api/usage.md index ab1922b1..788c426c 100644 --- a/www/src/content/docs/docs/introduction/api/usage.md +++ b/www/src/content/docs/docs/introduction/api/usage.md @@ -5,4 +5,31 @@ description: API Only Mode - Basic Usage ## Manual Function Usage Examples: -New examples coming soon... \ No newline at end of file +### getBlogPosts + +```astro frame="code" title="getBlogPosts()" +--- +import { getPosts } from '@matthiesenxyz/astro-ghostcms/api'; + +const dateOptions = {year:"numeric",month:"long",day:"numeric"} +const posts = await getPosts() +--- +{ posts?.map((post) => ( + +
+ {post.title} +

{post.title}

+ +

{post.excerpt}

+

+ {new Date(post.published_at).toLocaleDateString( "en-US",dateOptions )} +

+
+
+ )) +} +``` \ No newline at end of file diff --git a/www/src/content/docs/docs/introduction/getting-started.md b/www/src/content/docs/docs/introduction/getting-started.md index aa3d4382..9cc0952e 100644 --- a/www/src/content/docs/docs/introduction/getting-started.md +++ b/www/src/content/docs/docs/introduction/getting-started.md @@ -6,7 +6,7 @@ description: Getting Started - [Live Demo](https://demo.astro-ghostcms.xyz/) of the Astro-GhostCMS integration in action! - [Live Demo - Unlighthouse Test](https://test.demo.astro-ghostcms.xyz) for a Automatically updated Lighthouse test from every deploy! -- [Live Demo's Repo](https://github.com/MatthiesenXYZ/astro-ghostcms-demo) for an example of how the setup looks. +- [Live Demo's Repo](https://github.com/MatthiesenXYZ/astro-ghostcms) for an example of how the setup looks. Astro minimum Version: **Astro v4.0**