From a326c2f1daadf84412509ce894c94509a1483ab6 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:47:10 +0100 Subject: feat(examples): New basics template (#12472) Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com> --- examples/basics/src/assets/astro.svg | 1 + examples/basics/src/assets/background.svg | 1 + examples/basics/src/components/Welcome.astro | 209 +++++++++++++++++++++++++++ examples/basics/src/layouts/Layout.astro | 9 ++ examples/basics/src/pages/index.astro | 7 +- packages/astro/components/Welcome.astro | 172 ---------------------- packages/astro/components/index.ts | 2 - 7 files changed, 225 insertions(+), 176 deletions(-) create mode 100644 examples/basics/src/assets/astro.svg create mode 100644 examples/basics/src/assets/background.svg create mode 100644 examples/basics/src/components/Welcome.astro delete mode 100644 packages/astro/components/Welcome.astro diff --git a/examples/basics/src/assets/astro.svg b/examples/basics/src/assets/astro.svg new file mode 100644 index 000000000..8cf8fb0c7 --- /dev/null +++ b/examples/basics/src/assets/astro.svg @@ -0,0 +1 @@ + diff --git a/examples/basics/src/assets/background.svg b/examples/basics/src/assets/background.svg new file mode 100644 index 000000000..4b2be0ac0 --- /dev/null +++ b/examples/basics/src/assets/background.svg @@ -0,0 +1 @@ + diff --git a/examples/basics/src/components/Welcome.astro b/examples/basics/src/components/Welcome.astro new file mode 100644 index 000000000..d08955687 --- /dev/null +++ b/examples/basics/src/components/Welcome.astro @@ -0,0 +1,209 @@ +--- +import astroLogo from '../assets/astro.svg'; +import background from '../assets/background.svg'; +--- + +
+ +
+
+ Astro Homepage +

+ To get started, open the
src/pages
directory in your project. +

+ +
+
+ + + +

What's New in Astro 5.0?

+

+ From content layers to server islands, click to learn more about the new features and + improvements in Astro 5.0 +

+
+
+ + diff --git a/examples/basics/src/layouts/Layout.astro b/examples/basics/src/layouts/Layout.astro index a25b9e69d..e455c6106 100644 --- a/examples/basics/src/layouts/Layout.astro +++ b/examples/basics/src/layouts/Layout.astro @@ -11,3 +11,12 @@ + + diff --git a/examples/basics/src/pages/index.astro b/examples/basics/src/pages/index.astro index a2bf4ee37..c04f3602b 100644 --- a/examples/basics/src/pages/index.astro +++ b/examples/basics/src/pages/index.astro @@ -1,8 +1,11 @@ --- -import { Welcome } from 'astro:components'; +import Welcome from '../components/Welcome.astro'; import Layout from '../layouts/Layout.astro'; + +// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build +// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh. --- - + diff --git a/packages/astro/components/Welcome.astro b/packages/astro/components/Welcome.astro deleted file mode 100644 index 2f91eb5dd..000000000 --- a/packages/astro/components/Welcome.astro +++ /dev/null @@ -1,172 +0,0 @@ ---- -interface Props { - title?: string; -} - -const cards = [ - { - href: 'https://docs.astro.build/', - title: 'Documentation', - body: 'Learn how Astro works and explore the official API docs.', - }, - { - href: 'https://astro.build/integrations/', - title: 'Integrations', - body: 'Supercharge your project with new frameworks and libraries.', - }, - { - href: 'https://astro.build/themes/', - title: 'Themes', - body: 'Explore a galaxy of community-built starter themes.', - }, - { - href: 'https://astro.build/chat/', - title: 'Community', - body: 'Come say hi to our amazing Discord community. ❤️', - }, -]; - -const { title = 'Welcome to Astro' } = Astro.props; ---- - -
- -

{title}

-

- To get started, open the directory src/pages in your project.
- Code Challenge: Tweak the "Welcome to Astro" message above. -

- -
- - diff --git a/packages/astro/components/index.ts b/packages/astro/components/index.ts index 31a9bd597..4107dadfa 100644 --- a/packages/astro/components/index.ts +++ b/packages/astro/components/index.ts @@ -4,5 +4,3 @@ export { default as Code } from './Code.astro'; // @ts-ignore export { default as Debug } from './Debug.astro'; -// @ts-ignore -export { default as Welcome } from './Welcome.astro'; -- cgit v1.2.3