Inside of your project, you'll see the following folders and files:
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ ├── blog/
│ └── content.config.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
Folder Blog is used for the blogs
Other folders are used for classic website navigation.
Starlight looks for .md
or .mdx
files in the src/content/docs/
directory. Each file is exposed as a route based on its file name.
Images can be added to src/assets/
and embedded in Markdown with a relative link.
Static assets, like favicons, can be placed in the public/
directory.
To install the website locally:
- Install Node
- Execute
npm install
- Execute
npm run dev
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro -- --help |
Get help using the Astro CLI |
We are using the Starlight with many components that can be used directly in markdown! Do not hesitate to use them.
When adding a new wiki page, you must link the page in the astro.config.mjs under the starlightSidebarTopics
item.
It allows one to organize the page.
There are automatic way to import all pages, but they sort files by name, and sometimes we do not want that.
- Create a new file under
src/content/blog
- add the yaml
---
authors:
- BenoitVerhaeghe
title: "Coasters collection"
subtitle: "Or how to create a minimal model in Moose 8"
date: 2021-02-15
lastUpdated: 2021-03-04
tags:
- meta-model
---
For authors, use the key identified in astro.config.mjs
If you want to be sure the blogpost in not directly published, do not forget to add the frontmatter
---
# Exclude this page from production builds
draft: true
---
If you need to be added as author.
- Edit the file
astro.config.mjs
if the appropriate data. 2; Edit the filesrc/content/docs/about/authors.json
with the appropriate data.