From f207c417e08b2b5ad27cf185888b02392bb568e0 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 8 Aug 2022 12:34:05 -0500 Subject: [PATCH] Add Astro.generator (#4012) * feat: add generator property and component * chore: remove `Generator` component * chore: update generator description * chore: include generator in examples * chore: update lockfile * chore: format * fix: do not reference core from server runtime * chore: remove component test Co-authored-by: Nate Moore --- .changeset/happy-peas-attend.md | 18 +++++++++++++++ examples/basics/src/layouts/Layout.astro | 1 + examples/blog/src/components/BaseHead.astro | 1 + examples/component/demo/src/pages/index.astro | 1 + examples/docs/src/components/HeadCommon.astro | 1 + examples/env-vars/src/pages/index.astro | 1 + .../framework-alpine/src/pages/index.astro | 1 + .../framework-multiple/src/pages/index.astro | 1 + .../framework-preact/src/pages/index.astro | 1 + .../framework-react/src/pages/index.astro | 1 + .../framework-solid/src/pages/index.astro | 1 + .../framework-svelte/src/pages/index.astro | 1 + examples/framework-vue/src/pages/index.astro | 1 + examples/minimal/src/pages/index.astro | 1 + examples/non-html-pages/src/pages/index.astro | 1 + .../portfolio/src/components/MainHead.astro | 1 + examples/subpath/src/pages/index.astro | 1 + .../with-nanostores/src/layouts/Layout.astro | 1 + .../with-tailwindcss/src/pages/index.astro | 1 + .../src/pages/index.astro | 1 + packages/astro/src/@types/astro.ts | 10 ++++++++ packages/astro/src/runtime/server/index.ts | 3 +++ packages/astro/test/astro-generator.test.js | 23 +++++++++++++++++++ .../fixtures/astro-generator/package.json | 8 +++++++ .../astro-generator/src/pages/index.astro | 14 +++++++++++ pnpm-lock.yaml | 6 +++++ 26 files changed, 101 insertions(+) create mode 100644 .changeset/happy-peas-attend.md create mode 100644 packages/astro/test/astro-generator.test.js create mode 100644 packages/astro/test/fixtures/astro-generator/package.json create mode 100644 packages/astro/test/fixtures/astro-generator/src/pages/index.astro diff --git a/.changeset/happy-peas-attend.md b/.changeset/happy-peas-attend.md new file mode 100644 index 000000000..af3af1bfc --- /dev/null +++ b/.changeset/happy-peas-attend.md @@ -0,0 +1,18 @@ +--- +'astro': patch +--- + +Adds `Astro.generator` which can be used to add a [``](https://html.spec.whatwg.org/multipage/semantics.html#meta-generator) tag. + +```astro + + + + + + + + +``` diff --git a/examples/basics/src/layouts/Layout.astro b/examples/basics/src/layouts/Layout.astro index 9a46f2d8e..c75726968 100644 --- a/examples/basics/src/layouts/Layout.astro +++ b/examples/basics/src/layouts/Layout.astro @@ -12,6 +12,7 @@ const { title } = Astro.props as Props; + {title} diff --git a/examples/blog/src/components/BaseHead.astro b/examples/blog/src/components/BaseHead.astro index 80de975b1..af6fd380b 100644 --- a/examples/blog/src/components/BaseHead.astro +++ b/examples/blog/src/components/BaseHead.astro @@ -14,6 +14,7 @@ const { title, description } = Astro.props; + {title} diff --git a/examples/component/demo/src/pages/index.astro b/examples/component/demo/src/pages/index.astro index bfdf495a8..f0704e56b 100644 --- a/examples/component/demo/src/pages/index.astro +++ b/examples/component/demo/src/pages/index.astro @@ -6,6 +6,7 @@ import * as Component from '@example/my-component'; + Welcome to Astro