From c9d64e0dcc6a645cdc04785382f579d39f3cc44f Mon Sep 17 00:00:00 2001 From: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Date: Wed, 22 May 2024 22:12:51 -0500 Subject: [PATCH] update: improved examples in the reference documentation --- .../docs/reference/content-renderer.md | 24 ++----- .../src/content/docs/reference/dashboard.md | 62 +++++++------------ .../src/content/docs/reference/date-locale.md | 32 +++------- .../content/docs/reference/db-start-page.md | 28 +++------ .../content/docs/reference/image-service.md | 42 +++++-------- .../docs/reference/included-integrations.md | 34 +++------- .../content/docs/reference/marked-config.md | 32 +++------- .../src/content/docs/reference/overrides.md | 32 +++------- .../src/content/docs/reference/verbose.md | 26 +++----- 9 files changed, 94 insertions(+), 218 deletions(-) diff --git a/www/docs/src/content/docs/reference/content-renderer.md b/www/docs/src/content/docs/reference/content-renderer.md index 3fc639272..65e4a0380 100644 --- a/www/docs/src/content/docs/reference/content-renderer.md +++ b/www/docs/src/content/docs/reference/content-renderer.md @@ -7,26 +7,12 @@ description: A reference page for contentRenderer - **Type:** `'marked'| 'markdoc'` - **Default:** `marked` -`contentRenderer` is a string value that is used to determine how content should be rendered in the `Astro-Studio-CMS`. This is used to setup your content data. The default value is `marked` but you can also use `markdoc`. +`contentRenderer` is a string value that is used to determine how content should be rendered in the `astroStudioCMS`. This is used to setup your content data. The default value is `marked` but you can also use `markdoc`. ## Usage -```js title="astro.config.mjs" {14} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from '@astrojs/db'; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: 'https://example.com', - output: "server", - adapter: node({ mode: 'standalone' }), - integrations: [ - db(), - astroStudioCMS({ - contentRenderer: 'marked', - }) - ], -}); +```js title="astro.config.mjs" {2} + astroStudioCMS({ + contentRenderer: 'marked', + }) ``` diff --git a/www/docs/src/content/docs/reference/dashboard.md b/www/docs/src/content/docs/reference/dashboard.md index 89b6339d7..97348b693 100644 --- a/www/docs/src/content/docs/reference/dashboard.md +++ b/www/docs/src/content/docs/reference/dashboard.md @@ -3,50 +3,36 @@ title: dashboard description: A reference page for dashboard --- -`dashboard` option let's customize the dashboard for the `Astro-Studio-CMS`. This is used to setup your dashboard data. +`dashboard` option let's customize the dashboard for the `astroStudioCMS`. This is used to setup your dashboard data. ## Usage -```js title="astro.config.mjs" {14-35} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - dashboard: { - dashboardEnabled: true, - faviconURL: "/favicon.ico", - dashboardRouteOverride: "/components/dashboard", - AuthConfig: { - providers: { - github: true, - usernameAndPassword: true - }, - enabled: true +```js title="astro.config.mjs" {2-24} +astroStudioCMS({ + dashboard: { + dashboardEnabled: true, + faviconURL: "/favicon.ico", + dashboardRouteOverride: "/components/dashboard", + AuthConfig: { + providers: { + github: true, + usernameAndPassword: true }, - UnoCSSConfigOverride: { - injectReset: true, - injectEntry: true, - presetsConfig: { - presetDaisyUI: { - themes: ['dark', 'light'], - lightTheme: ['light'], - darkTheme: ['dark'], - } + enabled: true + }, + UnoCSSConfigOverride: { + injectReset: true, + injectEntry: true, + presetsConfig: { + presetDaisyUI: { + themes: ['dark', 'light'], + lightTheme: ['light'], + darkTheme: ['dark'], } } - }, // DEFAULT - This injects a dashboard to setup your dashboard data. - }), - ], -}); + } + }, // DEFAULT - This injects a dashboard to setup your dashboard data. +}) ``` ### `dashboardEnabled` diff --git a/www/docs/src/content/docs/reference/date-locale.md b/www/docs/src/content/docs/reference/date-locale.md index 2f73b9e49..0ef32c99b 100644 --- a/www/docs/src/content/docs/reference/date-locale.md +++ b/www/docs/src/content/docs/reference/date-locale.md @@ -3,29 +3,15 @@ title: dateLocale description: A reference page for dateLocale --- -`dateLocale` is a string value that is used to determine how dates should be formatted in the `Astro-Studio-CMS`. - -## Usage +- **Type:** `string` +- **Default:** `en-us` -```js title="astro.config.mjs" {14} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from '@astrojs/db'; -import node from "@astrojs/node"; +`dateLocale` is a string value that is used to determine how dates should be formatted in the `astroStudioCMS`. -// https://astro.build/config -export default defineConfig({ - site: 'https://example.com', - output: "server", - adapter: node({ mode: 'standalone' }), - integrations: [ - db(), - astroStudioCMS({ - dateLocale: 'en-us', - }) - ], -}); -``` +## Usage -- **Type:** `string` -- **Default:** `en-us` +```js title="astro.config.mjs" {2} +astroStudioCMS({ + dateLocale: 'en-us', +}) +``` \ No newline at end of file diff --git a/www/docs/src/content/docs/reference/db-start-page.md b/www/docs/src/content/docs/reference/db-start-page.md index d45ace78e..3caacac26 100644 --- a/www/docs/src/content/docs/reference/db-start-page.md +++ b/www/docs/src/content/docs/reference/db-start-page.md @@ -3,27 +3,15 @@ title: dbStartPage description: A reference page for dbStartPage --- -`dbStartPage` is a boolean value that is used to determine if the start page should be injected into the `Astro-Studio-CMS`. This is used to setup your DB data. +- **Type:** `boolean` +- **Default:** `true` +- +`dbStartPage` is a boolean value that is used to determine if the start page should be injected into the `astroStudioCMS`. This is used to setup your DB data. ## Usage -```js title="astro.config.mjs" {14} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; -- **Type:** `boolean | undefined` -- **Default:** `true` -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - dbStartPage: true, // DEFAULT - This injects a start page to setup your DB data. - }), - ], -}); +```js title="astro.config.mjs" {2} +astroStudioCMS({ + dbStartPage: true, // DEFAULT - This injects a start page to setup your DB data. +}) ``` diff --git a/www/docs/src/content/docs/reference/image-service.md b/www/docs/src/content/docs/reference/image-service.md index 6d2bf5f25..9d1d2ef7b 100644 --- a/www/docs/src/content/docs/reference/image-service.md +++ b/www/docs/src/content/docs/reference/image-service.md @@ -3,37 +3,23 @@ title: imageService description: A reference page for Image Service --- -`imageService` is an object value that is used to determine how images should be rendered in the `Astro-Studio-CMS`. This is used to setup your image data. +`imageService` is an object value that is used to determine how images should be rendered in the `astroStudioCMS`. This is used to setup your image data. ## Usage -```js title="astro.config.mjs" {14-23} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - imageService: { - useUnpic: false, - unpicConfig { - fallbackService: "unsplash", - placeholder: 'blurhash', - layout: 'constrained', - }, - astroImageServiceConfig: "squoosh", - cdnPlugin: "cloudinary", - }, - }), - ], -}); +```js title="astro.config.mjs" {2-11} +astroStudioCMS({ + imageService: { + useUnpic: false, + unpicConfig { + fallbackService: "unsplash", + placeholder: 'blurhash', + layout: 'constrained', + }, + astroImageServiceConfig: "squoosh", + cdnPlugin: "cloudinary", + }, +}), ``` ### `useUnpic` diff --git a/www/docs/src/content/docs/reference/included-integrations.md b/www/docs/src/content/docs/reference/included-integrations.md index 5d9c8e9d6..1d6afb28c 100644 --- a/www/docs/src/content/docs/reference/included-integrations.md +++ b/www/docs/src/content/docs/reference/included-integrations.md @@ -3,34 +3,18 @@ title: includedIntegrations description: A reference page for includedIntegrations --- -`includedIntegrations` is an object that is used to determine which Astro Integrations should be included in the `Astro-Studio-CMS`. Currently there are three Integrations that can be included: `useAstroRobots`, `astroRobotsConfig`, and `useInoxSitemap`. +`includedIntegrations` is an object that is used to determine which Astro Integrations should be included in the `astroStudioCMS`. Currently there are three Integrations that can be included: `useAstroRobots`, `astroRobotsConfig`, and `useInoxSitemap`. ## Usage -```js title="astro.config.mjs" {14-18} - -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - includedIntegrations: { - useAstroRobots: true, - astroRobotsConfig: true, - useInoxSitemap: true, - }, - }), - ], -}); - +```js title="astro.config.mjs" {2-6} +astroStudioCMS({ + includedIntegrations: { + useAstroRobots: true, + astroRobotsConfig: true, + useInoxSitemap: true, + }, +}), ``` ### `useAstroRobots` diff --git a/www/docs/src/content/docs/reference/marked-config.md b/www/docs/src/content/docs/reference/marked-config.md index d6bd8ea74..a7f071029 100644 --- a/www/docs/src/content/docs/reference/marked-config.md +++ b/www/docs/src/content/docs/reference/marked-config.md @@ -3,32 +3,18 @@ title: markedConfig description: A reference page for markedConfig --- -`markedConfig` is an object that is used to determine how content should be rendered in the `Astro-Studio-CMS`. This is used to setup your content data. +`markedConfig` is an object that is used to determine how content should be rendered in the `astroStudioCMS`. This is used to setup your content data. ## Usage -```js title="astro.config.mjs" {14-18} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - markedConfig: { - highlighterConfig: { - highlighter: "disabled", - }, - }, - }), - ], -}); +```js title="astro.config.mjs" {2-6} +astroStudioCMS({ + markedConfig: { + highlighterConfig: { + highlighter: "disabled", + }, + }, +}), ``` This property has the following options: diff --git a/www/docs/src/content/docs/reference/overrides.md b/www/docs/src/content/docs/reference/overrides.md index 0f542548b..42064b3ec 100644 --- a/www/docs/src/content/docs/reference/overrides.md +++ b/www/docs/src/content/docs/reference/overrides.md @@ -3,32 +3,18 @@ title: overrides description: A reference page for overrides --- -`overrides` is an object that is used to override the default configuration of the `Astro-Studio-CMS`. +`overrides` is an object that is used to override the default configuration of the `astroStudioCMS`. ## Usage -```js title="astro.config.mjs" {14-18} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; - -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - overrides: { - RendererOverride: "./src/components/MyCustomRenderer.astro", - CustomImageOverride: "./src/components/MyCustomImage.astro", - FormattedDateOverride: "./src/components/MyCustomFormattedDate.astro", - }, - }), - ], -}); +```js title="astro.config.mjs" {2-6} +astroStudioCMS({ + overrides: { + RendererOverride: "./src/components/MyCustomRenderer.astro", + CustomImageOverride: "./src/components/MyCustomImage.astro", + FormattedDateOverride: "./src/components/MyCustomFormattedDate.astro", + }, +}), ``` ### `RendererOverride` diff --git a/www/docs/src/content/docs/reference/verbose.md b/www/docs/src/content/docs/reference/verbose.md index 6dfb81889..80a616428 100644 --- a/www/docs/src/content/docs/reference/verbose.md +++ b/www/docs/src/content/docs/reference/verbose.md @@ -3,27 +3,15 @@ title: verbose description: A reference page for verbose --- -`verbose` is a boolean value that is used to determine if verbose logging should be enabled in the `Astro-Studio-CMS`. - **Type:** `boolean| undefined` - **Default:** `true` -## Usage -```js title="astro.config.mjs" {14} -import { defineConfig } from "astro/config"; -import astroStudioCMS from "@astrolicious/studiocms"; -import db from "@astrojs/db"; -import node from "@astrojs/node"; +`verbose` is a boolean value that is used to determine if verbose logging should be enabled in the `astroStudioCMS`. + +## Usage -// https://astro.build/config -export default defineConfig({ - site: "https://example.com", - output: "server", - adapter: node({ mode: "standalone" }), - integrations: [ - db(), - astroStudioCMS({ - verbose: true, // DEFAULT - This enables verbose logging in the Astro-Studio-CMS. - }), - ], -}); +```js title="astro.config.mjs" {2} +astroStudioCMS({ + verbose: true, // DEFAULT - This enables verbose logging in the Astro-Studio-CMS. +}), ```