Astro
The Skeleton documentation website is maintained using the Astro framework.
Integrations
Review the full list of integrations in astro.config.mjs
.
App Structure
Navigate the app structure within the /src
directory. This includes the following directories:
Path | Description |
---|---|
/components | Contains all doc site components. |
/content | Content collections for MDX page content. |
/examples | Documentation page code block examples. |
/icons | Contains custom SVG icons for the site. |
/layouts | The Astro page layouts. |
/pages | The Astro page route templates. |
/stores | A collection of Nanostores for state. |
/styles | All documentation website stylesheets. |
Pages
Standard Pages
- Browse to
/content/docs/
and create a new.mdx
file within the appropriate content collection. - Complete all required Frontmatter metadata within the frontmatter
---
fences. - New pages will be automatically added to the sidebar navigation.
Component Pages
Component page content is split into three files within /content/docs/components/{feature}/
.
meta.mdx
- common frontmatter metadata for the page header (ex: title, description, etc).react.mdx
- examples and usage information specific to the React component tab.svelte.mdx
- examples and usage information specific to the Svelte component tab.
Hidden Pages
If you wish to prevent a page from showing in the navigation, prefix it with an understore: _example.mdx
.
Using MDX
View the Astro MDX Documention or refer to /content/docs/resources/_markdown.md
for a “kitchen sink” example page.
MDX Components
This application makes use of custom MDX components to enable Skeleton typography styles for page contents. Browse these components within /src/components/mdx
. To enable MDX components for your page, add the following import.
Doc-Only Components
Functional components for the Astro project are housed in /src/components
. These support Astro/Svelte/React.
- Astro - used for simple presentational components without logic.
- React/Svelte - functional components that implement state, logic, or interaction.
Global Components
A suite of global components are automatically imported within MDX pages via astro-auto-importer.
TIP: These components are configure via
astro.config.mjs
>AutoImport()
in the project root.
Essential Code
Code Blocks are provided via Expressive Code via either the <Code>
component or Markdown fences. This is powered by the Shiki syntaxt highlighter. View the list of supported languages.
Preview
Allows you to quickly toggle between an exapmle component and it’s source code.
TIP: For React or Svelte components, make sure to use Astro’s hydration directives.
Tables
Provided by Markdown tables or the available Table component (/src/components/docs/Table.astro
). The Table component will auto-generate headings based on the key names in the first object row.
TIP: Optionally add the
tonal
orkbd
props to highlight content in the first column.
Icons
Lucide
This application implements the React version of Lucide for most icons. View Iconography details.
Astro Icons
Additionally, this application implements Astro-Icon for local custom SVGs and brand icon.
- Each icon must be provided in a
.svg
format. - Icon assets can be located in
/src/icons
- The
name
attribute should match the icon filename. - You must restart the Astro server when inserting new icons.