Skip to content

Commit

Permalink
update: improved examples in the reference documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dreyfus92 committed May 23, 2024
1 parent db2f9aa commit c9d64e0
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 218 deletions.
24 changes: 5 additions & 19 deletions www/docs/src/content/docs/reference/content-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
```
62 changes: 24 additions & 38 deletions www/docs/src/content/docs/reference/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
32 changes: 9 additions & 23 deletions www/docs/src/content/docs/reference/date-locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
```
28 changes: 8 additions & 20 deletions www/docs/src/content/docs/reference/db-start-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
})
```
42 changes: 14 additions & 28 deletions www/docs/src/content/docs/reference/image-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
34 changes: 9 additions & 25 deletions www/docs/src/content/docs/reference/included-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
32 changes: 9 additions & 23 deletions www/docs/src/content/docs/reference/marked-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
32 changes: 9 additions & 23 deletions www/docs/src/content/docs/reference/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
26 changes: 7 additions & 19 deletions www/docs/src/content/docs/reference/verbose.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}),
```

0 comments on commit c9d64e0

Please sign in to comment.