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 all 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
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 added www/docs/src/assets/CreateNewPageDark-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/CreateNewPageDark.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/CreateNewPageLight-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/CreateNewPageLight-2.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/DashboardDark.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/DashboardLight.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/EditPageDark-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/EditPageDark-2.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/EditPageLight-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/EditPageLight-2.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/ExistingPageLight.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/ExistingPagesDark.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/LoginPageDark.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/LoginPageLight.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/SiteAdminsDark.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/SiteConfigDark.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/UserProfileDark.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/UserProfileLight.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.
35 changes: 35 additions & 0 deletions www/docs/src/assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import LoginPageDark from "./LoginPageDark.png";
import LoginPageLight from "./LoginPageLight.png";
import CreateNewPageDark from "./CreateNewPageDark.png";
import CreateNewPageLight1 from "./CreateNewPageLight-1.png";
import CreateNewPageLight2 from "./CreateNewPageLight-2.png";
import DashboardDark from "./DashboardDark.png";
import DashboardLight from "./DashboardLight.png";
import EditPageDark1 from "./EditPageDark-1.png";
import EditPageDark2 from "./EditPageDark-2.png";
import EditPageLight1 from "./EditPageLight-1.png";
import EditPageLight2 from "./EditPageLight-2.png";
import SiteAdminsDark from "./SiteAdminsDark.png";
import SiteConfigDark from "./SiteConfigDark.png";
import UserProfileDark from "./UserProfileDark.png";
import UserProfileLight from "./UserProfileLight.png";

const galleryImages = [
{ imageMetadata:LoginPageDark, alt: "Login Page Dark" },
{ imageMetadata:LoginPageLight, alt: "Login Page Light" },
{ imageMetadata:CreateNewPageDark, alt: "Create New Page Dark" },
{ imageMetadata:CreateNewPageLight1, alt: "Create New Page Light 1" },
{ imageMetadata:CreateNewPageLight2, alt: "Create New Page Light 2" },
{ imageMetadata:DashboardDark, alt: "Dashboard Dark" },
{ imageMetadata:DashboardLight, alt: "Dashboard Light" },
{ imageMetadata:EditPageDark1, alt: "Edit Page Dark 1" },
{ imageMetadata:EditPageDark2, alt: "Edit Page Dark 2" },
{ imageMetadata:EditPageLight1, alt: "Edit Page Light 1" },
{ imageMetadata:EditPageLight2, alt: "Edit Page Light 2" },
{ imageMetadata:SiteAdminsDark, alt: "Site Admins Dark" },
{ imageMetadata:SiteConfigDark, alt: "Site Config Dark" },
{ imageMetadata:UserProfileDark, alt: "User Profile Dark" },
{ imageMetadata:UserProfileLight, alt: "User Profile Light" },
];

export default galleryImages;
117 changes: 117 additions & 0 deletions www/docs/src/components/Gallery.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
//TODO: Make this component reusable
import { Image } from "astro:assets";

import galleryImages from "../assets/index.ts"
const galleryImagesMinusFirst = galleryImages.slice(1)
---

<sl-carousel class="carousel-thumbnails" navigation loop>
{
galleryImages.map((image, index) => (
<sl-carousel-item id={index}>
<Image
src={image.imageMetadata}
alt={image.alt}
width="1280"
height="1900"
/>
</sl-carousel-item>
))
}
</sl-carousel>

<div class="thumbnails">
<div class="thumbnails__scroller">
<Image
src={galleryImages[0].imageMetadata}
alt={galleryImages[0].alt + ' ' + 'thumbnail'}
width="64"
height="64"
class="thumbnails__image active"
/>
{
galleryImagesMinusFirst.map((image) => (
<Image
class="thumbnails__image"
src={image.imageMetadata}
alt={image.alt + ' ' + 'thumbnail'}
width="64"
height="64"
/>
))
}
</div>
</div>

<script>
import type { SlCarousel } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/carousel/carousel.js';

const carousel = document.querySelector('.carousel-thumbnails') as SlCarousel;
const scroller = document.querySelector('.thumbnails__scroller') as HTMLElement;
const thumbnails = document.querySelectorAll('.thumbnails__image') as NodeListOf<HTMLElement>;

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); */
gap: 1rem;
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.

Loading
Loading