Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Chore: Docs #72

Merged
merged 33 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b3afb5f
Create draft PR for #68
create-issue-branch[bot] May 8, 2024
27c62b0
init docs
dreyfus92 May 8, 2024
794c8d9
remove: guides for now
dreyfus92 May 8, 2024
37c7a78
chore: extend tsconfig for path aliases
dreyfus92 May 9, 2024
16abfa7
update: why-studioCMS doc
dreyfus92 May 9, 2024
fc8eb88
add: getting-started doc
dreyfus92 May 9, 2024
541cf2b
fix: headings
dreyfus92 May 9, 2024
6aea24f
update: getting-started
dreyfus92 May 9, 2024
d5f3a52
add: og banner
dreyfus92 May 9, 2024
ac90e20
more docs n stuff
dreyfus92 May 9, 2024
588dfc7
fix: site var declaration
dreyfus92 May 9, 2024
9d24244
update: config
dreyfus92 May 11, 2024
5a2daa7
update: getting-started
dreyfus92 May 11, 2024
459dafe
update: environment-variables & getting-started
dreyfus92 May 11, 2024
f735500
fix: missing example
dreyfus92 May 11, 2024
5280861
update `db-start-page` and adds `image-service`
dreyfus92 May 14, 2024
9774c2c
add: `dashboard` reference
dreyfus92 May 15, 2024
9404368
update: `image-service` on how to present types and def type.
dreyfus92 May 15, 2024
4ae4801
add: `include-integrations` reference
dreyfus92 May 15, 2024
a694216
add: `dateLocale` reference
dreyfus92 May 15, 2024
8573f67
add: `overrides` and `verbose` references
dreyfus92 May 15, 2024
e812107
add: `gallery` and update `reference`
dreyfus92 May 15, 2024
9142a04
test: removing div to see if it fixes zooming?
dreyfus92 May 15, 2024
10a9887
test: assets refactor for prod
dreyfus92 May 16, 2024
4eb45f1
more testing
dreyfus92 May 16, 2024
cdfc587
testing with latest version of deps.
dreyfus92 May 16, 2024
2c29de0
testing md convention of adding images
dreyfus92 May 16, 2024
4e1c8db
add: gallery comp
dreyfus92 May 20, 2024
10561a6
fix: import in gallery comp
dreyfus92 May 20, 2024
78bd788
refactor: gallery comp and add more images.
dreyfus92 May 21, 2024
51bcf76
Apply suggestions from Jumper's review pt. 1
dreyfus92 May 21, 2024
db2f9aa
add: type assertions as suggested by Jumper
dreyfus92 May 21, 2024
c9d64e0
update: improved examples in the reference documentation
dreyfus92 May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,008 changes: 908 additions & 100 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Binary file added www/assets/studioCMS.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old logo!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 57 additions & 13 deletions www/docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,37 +1,81 @@
import { defineConfig } from 'astro/config'
import starlight from '@astrojs/starlight'
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

// https://astro.build/config

const site = "https://docs.astro-studiocms.xyz/";

export default defineConfig({
site,
integrations: [
starlight({
title: 'My Docs',
title: "Astro StudioCMS",
description:
"A dedicated CMS for Astro Studio. Built from the ground up by the Astro community.",
favicon: "/logo-dark.svg",
logo: {
dark: "../assets/logo-light.svg",
light: "../assets/logo-dark.svg",
},
social: {
github: 'https://github.com/withastro/starlight',
github: "https://github.com/astrolicious/studiocms",
},
customCss: [
// Relative path to your custom CSS file
"./src/styles/custom.css",
],
editLink: {
baseUrl: "https://github.com/astrolicious/studiocms/tree/main/www/docs",
},
head: [
{
tag: 'script',
tag: "script",
attrs: {
src: 'https://analytics.astro-studiocms.xyz/script.js',
'data-website-id': 'd9823e76-3219-4f86-9a09-0cb763ebfd19',
src: "https://analytics.astro-studiocms.xyz/script.js",
"data-website-id": "d9823e76-3219-4f86-9a09-0cb763ebfd19",
defer: true,
},
},
{
tag: "meta",
attrs: {
property: "og:image",
content: site + "og.png?v=1",
},
},
{
tag: "meta",
attrs: {
property: "twitter:image",
content: site + "og.png?v=1",
},
},
],
sidebar: [
{
label: 'Guides',
label: "Start Here",
items: [
// Each item here is one entry in the navigation menu.
{ label: 'Example Guide', link: '/guides/example/' },
{
label: "Getting Started with Astro StudioCMS",
link: "/start-here/getting-started",
},
{
label: "Environment Variables",
link: "/start-here/environment-variables",
},
{
label: "Why Astro StudioCMS?",
link: "/start-here/why-studiocms",
},
{ label: "Gallery", link: "/start-here/gallery" },
],
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
label: "Reference",
autogenerate: { directory: "reference" },
},
],
lastUpdated: true,
}),
],
})
});
11 changes: 6 additions & 5 deletions www/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.22.0",
"astro": "^4.3.5",
"sharp": "^0.33.0",
"@astrojs/check": "^0.5.10",
"typescript": "^5.4.3"
"@astrojs/check": "^0.7.0",
"@astrojs/starlight": "^0.22.3",
"@shoelace-style/shoelace": "^2.15.0",
"astro": "^4.8.4",
"sharp": "^0.33.3",
"typescript": "^5.4.5"
}
}
1 change: 0 additions & 1 deletion www/docs/public/favicon.svg

This file was deleted.

59 changes: 59 additions & 0 deletions www/docs/public/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/public/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed www/docs/src/assets/houston.webp
Binary file not shown.
Binary file added www/docs/src/assets/login-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/src/assets/login-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions www/docs/src/components/Gallery.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
//TODO: Make this component reusable
import { Image } from "astro:assets";
import DarkLogin from "../assets/login-1.png";
import LightLogin from "../assets/login-2.png";
---

<sl-carousel class="carousel-thumbnails" navigation loop>
<sl-carousel-item>
<Image
alt="Login screen dark theme"
src={DarkLogin}
height="1900"
/>
</sl-carousel-item>
<sl-carousel-item>
<Image
alt="Login screen light theme"
src={LightLogin}
height="1900"
/>
</sl-carousel-item>
</sl-carousel>

<div class="thumbnails">
<div class="thumbnails__scroller">
<Image
alt="Thumbnail of Login screen dark theme"
class="thumbnails__image active"
src={DarkLogin}
width={64}
height={64}
/>
<Image
alt="Login screen light theme"
class="thumbnails__image active"
src={LightLogin}
width={64}
height={64}
/>
</div>
</div>

<script>
import type { SlCarousel} from '@shoelace-style/shoelace';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is dis working.... dashboard threw a fit when i tried to do this...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the npm package

import "@shoelace-style/shoelace"

const carousel = document.querySelector('.carousel-thumbnails') as SlCarousel;
const scroller = document.querySelector('.thumbnails__scroller');
const thumbnails = document.querySelectorAll('.thumbnails__image');
dreyfus92 marked this conversation as resolved.
Show resolved Hide resolved

scroller?.addEventListener('click', e => {
const target = e.target as HTMLElement;

if (target?.matches('.thumbnails__image')) {
const index = [...thumbnails].indexOf(target);
carousel.goToSlide(index);
}
});

carousel?.addEventListener('sl-slide-change', e => {
const slideIndex = e.detail.index;

[...thumbnails].forEach((thumb, i) => {
thumb.classList.toggle('active', i === slideIndex);
if (i === slideIndex) {
thumb.scrollIntoView({
block: 'nearest'
});
}
});
});
</script>

<style>
.carousel-thumbnails {
--slide-aspect-ratio: 3 / 2;
}

.thumbnails {
display: flex;
justify-content: center;
}

.thumbnails__scroller {
display: flex;
gap: var(--sl-spacing-small);
overflow-x: auto;
scrollbar-width: none;
scroll-behavior: smooth;
scroll-padding: var(--sl-spacing-small);
}

.thumbnails__scroller::-webkit-scrollbar {
display: none;
}

.thumbnails__image {
width: 64px;
height: 64px;
object-fit: cover;

opacity: 0.3;
will-change: opacity;
transition: 250ms opacity;

cursor: pointer;
}

.thumbnails__image.active {
opacity: 1;
}
</style>
15 changes: 15 additions & 0 deletions www/docs/src/components/PackageManagerTabs.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs syncKey="packageManagers">
<TabItem label="npm" icon="seti:npm">
<slot name="npm" />
</TabItem>
<TabItem label="pnpm" icon="pnpm">
<slot name="pnpm" />
</TabItem>
<TabItem label="Yarn" icon="seti:yarn">
<slot name="yarn" />
</TabItem>
</Tabs>
13 changes: 0 additions & 13 deletions www/docs/src/content/docs/guides/example.md

This file was deleted.

38 changes: 10 additions & 28 deletions www/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
---
title: Welcome to Starlight
description: Get started building your docs site with Starlight.
title: Welcome to Astro StudioCMS
description: Get started building with it.
dreyfus92 marked this conversation as resolved.
Show resolved Hide resolved
template: splash
hero:
tagline: Congrats on setting up a new Starlight project!
tagline: A dedicated CMS for Astro Studio. Built from the ground up by the Astro community.
image:
file: ../../assets/houston.webp
file: ../../../../assets/studioCMS.png
alt: Astro StudioCMS
actions:
- text: Example Guide
link: /guides/example/
- text: Get started
link: /start-here/getting-started
icon: right-arrow
variant: primary
- text: Read the Starlight docs
link: https://starlight.astro.build
icon: external
- text: GitHub repository
link: https://github.com/astrolicious/studiocms
icon: github
---

import { Card, CardGrid } from '@astrojs/starlight/components'

## Next steps

<CardGrid stagger>
<Card title='Update content' icon='pencil'>
Edit `src/content/docs/index.mdx` to see this page change.
</Card>
<Card title='Add new content' icon='add-document'>
Add Markdown or MDX files to `src/content/docs` to create new pages.
</Card>
<Card title='Configure your site' icon='setting'>
Edit your `sidebar` and other config in `astro.config.mjs`.
</Card>
<Card title='Read the docs' icon='open-book'>
Learn more in [the Starlight Docs](https://starlight.astro.build/).
</Card>
</CardGrid>
28 changes: 28 additions & 0 deletions www/docs/src/content/docs/reference/content-renderer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: contentRenderer
description: A reference page for contentRenderer
---

dreyfus92 marked this conversation as resolved.
Show resolved Hide resolved
`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`.

## 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',
})
],
});
```
dreyfus92 marked this conversation as resolved.
Show resolved Hide resolved
Loading