├── public
├── robots.txt
├── style
│ ├── global.css
│ └── home.css
├── favicon.svg
└── assets
│ └── logo.svg
├── .npmrc
├── netlify.toml
├── src
├── components
│ ├── Counter.module.css
│ ├── Counter.jsx
│ └── Tour.astro
└── pages
│ └── index.astro
├── .gitignore
├── package.json
└── README.md
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow: /
3 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | ## force pnpm to hoist
2 | shamefully-hoist = true
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | command = "npm run build"
3 | publish = "dist"
--------------------------------------------------------------------------------
/src/components/Counter.module.css:
--------------------------------------------------------------------------------
1 | .counter {
2 | margin: 20px 0;
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # build output
2 | dist
3 |
4 | # dependencies
5 | node_modules/
6 | .snowpack/
7 |
8 | # logs
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 |
13 | # environment variables
14 | .env
15 | .env.production
16 |
17 | # macOS-specific files
18 | .DS_Store
19 |
20 | # Local Netlify folder
21 | .netlify
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "astro-netlify-starter",
3 | "version": "0.3.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "astro dev",
7 | "start": "astro dev",
8 | "build": "astro build",
9 | "preview": "astro preview"
10 | },
11 | "devDependencies": {
12 | "astro": "^0.21.6"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/components/Counter.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import styles from './Counter.module.css'
3 |
4 | export default function Counter() {
5 | const [count, setCount] = useState(0)
6 |
7 | return (
8 |
9 |
Simple React Counter
10 |
Count: {count}
11 |
12 |
13 |
14 | )
15 | }
16 |
--------------------------------------------------------------------------------
/public/style/global.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | margin: 0;
4 | }
5 |
6 | :root {
7 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
8 | font-size: 1rem;
9 | --user-font-scale: 1rem - 16px;
10 | font-size: clamp(0.875rem, 0.4626rem + 1.0309vw + var(--user-font-scale), 1.125rem);
11 | }
12 |
13 | body {
14 | padding: 4rem 2rem;
15 | width: 100%;
16 | min-height: 100vh;
17 | display: grid;
18 | justify-content: center;
19 | background: #f9fafb;
20 | color: #111827;
21 | }
22 |
23 | @media (prefers-color-scheme: dark) {
24 | body {
25 | background: #111827;
26 | color: #fff;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/index.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import Tour from '../components/Tour.astro';
3 |
4 | let title = 'My New Astro Site!';
5 |
6 | ---
7 |
8 |
9 |
10 |
11 |
12 |
13 | {title}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |

24 |
Welcome to Astro
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/public/style/home.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --font-mono: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
3 | --color-light: #F3F4F6;
4 | }
5 |
6 | @media (prefers-color-scheme: dark) {
7 | :root {
8 | --color-light: #1F2937;
9 | }
10 | }
11 |
12 | a {
13 | color: inherit;
14 | }
15 |
16 | header > div {
17 | font-size: clamp(2rem, -0.4742rem + 6.1856vw, 2.75rem);
18 | }
19 |
20 | header > div {
21 | display: flex;
22 | flex-direction: column;
23 | align-items: center;
24 | }
25 |
26 | header h1 {
27 | font-size: 1em;
28 | font-weight: 500;
29 | }
30 | header img {
31 | width: 2em;
32 | height: 2.667em;
33 | }
34 |
35 | h2 {
36 | font-weight: 500;
37 | font-size: clamp(1.5rem, 1rem + 1.25vw, 2rem);
38 | }
39 |
--------------------------------------------------------------------------------
/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/public/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Astro + Netlify Starter
2 |
3 | [](https://app.netlify.com/sites/astro-netlify/deploys)
4 |
5 | This is an Astro (v0.21.6) starter project based on the [Astro Starter Kit](https://github.com/withastro/astro/tree/main/examples/starter), with a `netlify.toml` configuration included, and an example React component + CSS Module.
6 |
7 | If you'd like to learn more about how Astro works, [here's an introductory blog post](https://dev.to/cassidoo/build-wicked-fast-sites-with-astro-an-introduction-173j)!
8 |
9 | ## Clone and Deploy
10 |
11 | You can instantly clone this to your GitHub and deploy it by clicking this button here:
12 |
13 | [](https://app.netlify.com/start/deploy?repository=https://github.com/cassidoo/astro-netlify-starter)
14 |
15 | Or, if you'd like to just use the CLI and not deploy just yet, you can use `create-astro` with this as a template:
16 |
17 | ```bash
18 | npm init astro my-new-project --template cassidoo/astro-netlify-starter
19 | ```
20 |
21 | ## Commands
22 |
23 | All commands are run from the root of the project, from a terminal:
24 |
25 | | Command | Action |
26 | | :-------------- | :------------------------------------------ |
27 | | `npm install` | Installs dependencies |
28 | | `npm run start` | Starts local dev server at `localhost:3000` |
29 | | `npm run build` | Build your production site to `./dist/` |
30 |
31 | ## Want to learn more?
32 |
33 | Feel free to check [the Astro documentation](https://docs.astro.build/getting-started/)!
34 |
--------------------------------------------------------------------------------
/src/components/Tour.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import { Markdown } from 'astro/components';
3 | import Counter from './Counter.jsx';
4 | ---
5 |
6 |
7 |
8 | ## 🚀 Project Structure
9 |
10 | In this project, you'll see the following folders and files:
11 |
12 | ```
13 | /
14 | ├── public/
15 | │ ├── robots.txt
16 | │ └── favicon.ico
17 | ├── src/
18 | │ ├── components/
19 | │ │ └── Counter.jsx
20 | │ │ └── Counter.module.css
21 | │ │ └── Tour.astro
22 | │ └── pages/
23 | │ └── index.astro
24 | ├── netlify.toml
25 | └── package.json
26 | ```
27 |
28 | Static assets can be placed in the `public/` directory.
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Feel free to check out the Astro documentation to learn more,
38 | or see the code for this site here.
39 |
40 |
41 |
42 |
43 |
44 |
77 |
--------------------------------------------------------------------------------