npm create astro@latest -- --template minimal🧑🚀 Seasoned astronaut? Delete this file. Have fun!
Inside of your Astro project, you'll see the following folders and files:
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.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.
There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Any static assets, like images, can be placed in the public/ directory.
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 |
Feel free to check our documentation or jump into our Discord server.
- Navigate to src/styles/card.css
- Under "Selected tab style" comment add
- ,#tabN:checked ~ .tab-labels label[for="tabN"]
- where N = next tab number
- Under "Ensure the panel doesn't overlap the tab visually" comment near the bottom, add
- ,#tabN:checked ~ .card-panels #cardN
- where N = next tab number
- Navigate to src/pages/blog.astro
- If you need to make a new map for a directory
- Add dirctory in src/blog/
- In frontmatter under the "//get posts from certain directories" comment, add
- const postsMap = sortedPosts.filter(post => post.id.startsWith('blogDir/'));
- Where postsMap = name of map, blogDir = directory where posts live
- In <div class="stack-tabs"> </div>
- Under "<!-- Inputs must come first -->" comment, add
- <input type="radio" name="tab" id="tabN" hidden />
- where N = next tab number
- Under "<!-- Then the labels -->" comment, add
- <label for="tabN">Other Board
- where N = next tab number
- Under "<!-- Then the panels -->" comment, add
- <section id="card2"></section>
- Inside it add: <div class="index-card-stack"></div>
- Inside it add: <div class="index-card"></div>
- Inside it add:
- <span class="index-card-label">LabelN</span>
- Where LabelN = tab label name
- <p>Content message.</p>
- <ul>{ PostsMap.map((post) => (<BlogPost url={
/posts/${post.id}/} title={post.data.title} />))}</ul>- Where PostsMap = name of mapped posts directory being used
- <span class="index-card-label">LabelN</span>
- Under "<!-- Inputs must come first -->" comment, add
- If you need to make a new map for a directory