diff --git a/.changeset/cold-kiwis-arrive.md b/.changeset/cold-kiwis-arrive.md deleted file mode 100644 index af1da9a2c..000000000 --- a/.changeset/cold-kiwis-arrive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'create-astro': patch ---- - -Bugfix: select component missing space diff --git a/.changeset/config.json b/.changeset/config.json index 7a974074c..51e0c0af5 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, - "linked": [["astro", "astro-parser", "create-astro"]], + "linked": [["astro", "astro-parser"]], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", diff --git a/examples/blog/src/components/Counter.jsx b/examples/blog/src/components/Counter.jsx deleted file mode 100644 index c9b27e1a7..000000000 --- a/examples/blog/src/components/Counter.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import React, { useState } from 'react'; -// import confetti from 'canvas-confetti'; - -export default function Counter() { - // Declare a new state variable, which we'll call "count" - const [count, setCount] = useState(0); - // console.log(confetti()); - - return ( -
-

You clicked {count} times

- -
- ); -} diff --git a/examples/blog/src/components/Nav.astro b/examples/blog/src/components/Nav.astro index 86919ac4d..5949adb0d 100644 --- a/examples/blog/src/components/Nav.astro +++ b/examples/blog/src/components/Nav.astro @@ -4,9 +4,13 @@ export let title; + + diff --git a/packages/create-astro/src/templates/blog/src/components/Pagination.astro b/packages/create-astro/src/templates/blog/src/components/Pagination.astro new file mode 100644 index 000000000..7b01e59b5 --- /dev/null +++ b/packages/create-astro/src/templates/blog/src/components/Pagination.astro @@ -0,0 +1,40 @@ +--- +export let prevUrl: string; +export let nextUrl: string; +--- + + + +
+ +
diff --git a/packages/create-astro/src/templates/blog/src/components/PostPreview.astro b/packages/create-astro/src/templates/blog/src/components/PostPreview.astro new file mode 100644 index 000000000..59c54e8fa --- /dev/null +++ b/packages/create-astro/src/templates/blog/src/components/PostPreview.astro @@ -0,0 +1,63 @@ +--- +export let post; +export let author; + +function formatDate(date) { + return new Date(date).toUTCString().replace(/(\d\d\d\d) .*/, '$1'); // remove everything after YYYY +} +--- + + + +
+ +
+

{post.title}

+ {author.name} + +

+ {post.description} + Read +

+
+
diff --git a/packages/create-astro/src/templates/blog/src/data/authors.json b/packages/create-astro/src/templates/blog/src/data/authors.json new file mode 100644 index 000000000..e958e7cd1 --- /dev/null +++ b/packages/create-astro/src/templates/blog/src/data/authors.json @@ -0,0 +1,10 @@ +{ + "don": { + "name": "Don Quixote", + "image": "/authors/don.jpg" + }, + "sancho": { + "name": "Sancho Panza", + "image": "/authors/sancho.jpg" + } +} diff --git a/packages/create-astro/src/templates/blog/src/layouts/post.astro b/packages/create-astro/src/templates/blog/src/layouts/post.astro new file mode 100644 index 000000000..5149528a0 --- /dev/null +++ b/packages/create-astro/src/templates/blog/src/layouts/post.astro @@ -0,0 +1,79 @@ +--- +import MainHead from '../components/MainHead.astro'; +import Nav from '../components/Nav.astro'; + +export let content; + +import authorData from '../data/authors.json'; +--- + + + + {content.title} + + + + + +