Skip to content

Commit

Permalink
Add minimal template (withastro#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Aug 15, 2021
1 parent 072dabe commit d68ac85
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/minimal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# build output
dist

# dependencies
node_modules/
.snowpack/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
2 changes: 2 additions & 0 deletions examples/minimal/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## force pnpm to hoist
shamefully-hoist = true
34 changes: 34 additions & 0 deletions examples/minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# [Astro](https://astro.build)

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

```
/
├── public/
│ ├── robots.txt
│ └── favicon.ico
├── 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.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
|:----------------|:--------------------------------------------|
| `npm install` | Installs dependencies |
| `npm start` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |

## 👀 Want to learn more?

Feel free to check [our documentation](https://github.com/snowpackjs/astro) or jump into our [Discord server](https://astro.build/chat).
3 changes: 3 additions & 0 deletions examples/minimal/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
renderers: [],
}
12 changes: 12 additions & 0 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@example/minimal",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "astro dev",
"build": "astro build"
},
"devDependencies": {
"astro": "^0.18.12"
}
}
2 changes: 2 additions & 0 deletions examples/minimal/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
15 changes: 15 additions & 0 deletions examples/minimal/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
---
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Welcome to Astro</title>
</head>

<body>
<h1>Welcome to <a href="https://astro.build/">Astro</a></h1>
</body>

</html>
5 changes: 5 additions & 0 deletions packages/create-astro/src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ export const TEMPLATES = [
value: 'portfolio',
renderers: ['@astrojs/renderer-preact'],
},
{
title: 'Minimal',
value: 'minimal',
renderers: [],
},
];

0 comments on commit d68ac85

Please sign in to comment.