From 93c2cc0553d8b79dbc9b3c6d2bef7138b631c163 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 14 Apr 2022 12:09:42 -0700 Subject: [PATCH] update starter template (#3109) --- examples/starter/public/{assets => }/logo.svg | 0 examples/starter/src/components/Logo.astro | 9 ++ examples/starter/src/components/Tour.astro | 84 ------------------- examples/starter/src/content/Tour.md | 28 +++++++ examples/starter/src/pages/index.astro | 38 +++++++-- 5 files changed, 68 insertions(+), 91 deletions(-) rename examples/starter/public/{assets => }/logo.svg (100%) create mode 100644 examples/starter/src/components/Logo.astro delete mode 100644 examples/starter/src/components/Tour.astro create mode 100644 examples/starter/src/content/Tour.md diff --git a/examples/starter/public/assets/logo.svg b/examples/starter/public/logo.svg similarity index 100% rename from examples/starter/public/assets/logo.svg rename to examples/starter/public/logo.svg diff --git a/examples/starter/src/components/Logo.astro b/examples/starter/src/components/Logo.astro new file mode 100644 index 000000000..02c68c7f0 --- /dev/null +++ b/examples/starter/src/components/Logo.astro @@ -0,0 +1,9 @@ +--- +// Export a "Props" interface to . +export interface Props { + height?: number, + width?: number, +} +const {height = 80, width = 60 } = Astro.props; +--- +Astro logo diff --git a/examples/starter/src/components/Tour.astro b/examples/starter/src/components/Tour.astro deleted file mode 100644 index 9a9ebe17f..000000000 --- a/examples/starter/src/components/Tour.astro +++ /dev/null @@ -1,84 +0,0 @@ ---- -import { Markdown } from 'astro/components'; ---- - -
- - -
- - ## 🚀 Project Structure - - Inside of your Astro project, you'll see the following folders and files: - - ``` - / - ├── public/ - │ └── favicon.ico - ├── src/ - │ ├── components/ - │ │ └── Tour.astro - │ └── 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. - -
- -
-

👀 Want to learn more?

-

Feel free to check our documentation or jump into our Discord server.

-
-
- - diff --git a/examples/starter/src/content/Tour.md b/examples/starter/src/content/Tour.md new file mode 100644 index 000000000..421b13e11 --- /dev/null +++ b/examples/starter/src/content/Tour.md @@ -0,0 +1,28 @@ +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +``` +├── public/ +│ ├── logo.svg +│ └── favicon.ico +├── src/ +│ ├── components/ +│ │ └── Logo.astro +│ ├── content/ +│ │ └── Tour.md +│ └── 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. + + +## 👀 Want to learn more? +Check out the [Astro Documentation](https://github.com/withastro/astro) site or jump into our [Discord server](https://astro.build/chat). diff --git a/examples/starter/src/pages/index.astro b/examples/starter/src/pages/index.astro index 1de0ce37d..ea853b668 100644 --- a/examples/starter/src/pages/index.astro +++ b/examples/starter/src/pages/index.astro @@ -1,10 +1,8 @@ --- -// Style Imports +import {Content as TourContent} from '../content/Tour.md'; +import Logo from '../components/Logo.astro'; import '../styles/global.css'; import '../styles/home.css'; -// Component Imports -import Tour from '../components/Tour.astro'; -// You can import components from any supported Framework here! /* ASTRO:COMPONENT_IMPORTS */ // Component Script: @@ -31,25 +29,51 @@ let title = 'My Astro Site'; gap: 1em; max-width: min(100%, 68ch); } + article { + padding-top: 2em; + line-height: 1.5; + display: flex; + flex-direction: column; + gap: 1em; + max-width: 70ch; + } + .banner { + text-align: center; + font-size: 1.2rem; + background: var(--color-light); + padding: 1em 1.5em; + padding-left: 0.75em; + border-radius: 4px; + } + +
- Astro logo +

Welcome to Astro

- +
+ + +