Skip to content

Commit

Permalink
📝 EVen closer
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory <tajemniktv@outlook.com>
  • Loading branch information
tajemniktv committed Nov 10, 2024
1 parent fa8f379 commit 99ac8ff
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 47 deletions.
5 changes: 1 addition & 4 deletions starlight/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# build output
dist/

# generated types
.astro/

Expand All @@ -13,12 +12,10 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
3 changes: 2 additions & 1 deletion starlight/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"astro-build.astro-vscode"
"astro-build.astro-vscode",
"stripe.markdoc-language-support"
],
"unwantedRecommendations": []
}
53 changes: 27 additions & 26 deletions starlight/README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
# Astro Starter Kit: Basics
# Starlight Starter Kit: Markdoc

```sh
npm create astro@latest -- --template basics
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
npm create astro@latest -- --template starlight/markdoc
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/markdoc)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/markdoc)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/markdoc)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fmarkdoc&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:
Inside of your Astro + Starlight project, you'll see the following folders and files:

```text
/
```
.
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── markdoc.config.mjs
├── package.json
└── tsconfig.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file
name.
Starlight looks for `.md`, `.mdx` or `.mdoc` files in the `src/content/docs/` directory. Each file is exposed as a route
based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact
components.
Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Any static assets, like images, can be placed in the `public/` directory.
Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

Expand All @@ -53,5 +54,5 @@ All commands are run from the root of the project, from a terminal:

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into
our [Discord server](https://astro.build/chat).
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build),
or jump into the [Astro Discord server](https://astro.build/chat).
28 changes: 26 additions & 2 deletions starlight/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
// @ts-check
import {defineConfig} from 'astro/config';
import starlight from '@astrojs/starlight';
import markdoc from '@astrojs/markdoc';

// https://astro.build/config
export default defineConfig({});
export default defineConfig({
integrations: [
markdoc(),
starlight({
title: 'My Docs',
social: {
github: 'https://github.com/withastro/starlight',
},
sidebar: [
{
label: 'Guides',
items: [
// Each item here is one entry in the navigation menu.
{label: 'Example Guide', slug: 'guides/example'},
],
},
{
label: 'Reference',
autogenerate: {directory: 'reference'},
},
],
}),
],
});
7 changes: 7 additions & 0 deletions starlight/markdoc.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {defineMarkdocConfig} from '@astrojs/markdoc/config';
import starlightMarkdoc from '@astrojs/starlight-markdoc';

// https://docs.astro.build/en/guides/integrations-guide/markdoc/
export default defineMarkdocConfig({
extends: [starlightMarkdoc()],
});
11 changes: 7 additions & 4 deletions starlight/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "starlight",
"name": "@example/starlight-markdoc",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/markdoc": "^0.11.4",
"@astrojs/starlight": "^0.29.0",
"@astrojs/starlight-markdoc": "^0.1.0",
"astro": "^4.16.10",
"@astrojs/check": "^0.9.4",
"typescript": "^5.6.3"
"sharp": "^0.32.5"
}
}
16 changes: 7 additions & 9 deletions starlight/public/favicon.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 starlight/src/assets/houston.webp
Binary file not shown.
6 changes: 6 additions & 0 deletions starlight/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {defineCollection} from 'astro:content';
import {docsSchema} from '@astrojs/starlight/schema';

export const collections = {
docs: defineCollection({schema: docsSchema()}),
};
11 changes: 11 additions & 0 deletions starlight/src/content/docs/guides/example.mdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Example Guide
description: A guide in my new Starlight docs site.
---

Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
Writing a good guide requires thinking about what your users are trying to do.

## Further reading

- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
35 changes: 35 additions & 0 deletions starlight/src/content/docs/index.mdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Welcome to Starlight
description: Get started building your docs site with Starlight.
template: splash
hero:
title: Welcome to Starlight with Markdoc
tagline: Congrats on setting up a new Starlight project!
image:
file: ../../assets/houston.webp
actions:
- text: Example Guide
link: /guides/example/
icon: right-arrow
- text: Read the Starlight docs
link: https://starlight.astro.build
icon: external
variant: minimal
---

## Next steps

{% cardgrid stagger=true %}
{% card title="Update content" icon="pencil" %}
Edit `src/content/docs/index.mdoc` to see this page change.
{% /card %}
{% card title="Add new content" icon="add-document" %}
Add Markdoc 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 %}
11 changes: 11 additions & 0 deletions starlight/src/content/docs/reference/example.mdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Example Reference
description: A reference page in my new Starlight docs site.
---

Reference pages are ideal for outlining how things work in terse and clear terms.
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting.

## Further reading

- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework
2 changes: 1 addition & 1 deletion starlight/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference path="../.astro/types.d.ts" />

0 comments on commit 99ac8ff

Please sign in to comment.