Add a head bubbling example
This commit is contained in:
parent
9fcc9fb526
commit
919e22d99a
5 changed files with 58 additions and 0 deletions
15
examples/head-bubbling/package.json
Normal file
15
examples/head-bubbling/package.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "@example/head-bubbling",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^2.0.11"
|
||||
}
|
||||
}
|
14
examples/head-bubbling/src/components/Post.astro
Normal file
14
examples/head-bubbling/src/components/Post.astro
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
const title = 'Blog Post';
|
||||
const description = 'Some description';
|
||||
---
|
||||
|
||||
<head>
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} /></head>
|
||||
</head>
|
||||
|
||||
<article>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eget commodo lacus. Sed hendrerit vel tortor in viverra. Praesent a lectus ex. Cras hendrerit ligula in sapien euismod maximus. Duis vel consectetur nibh, sed tempus est. Nullam sit amet iaculis nisl. Suspendisse efficitur libero eu magna varius faucibus a a nulla. Aliquam pretium diam ut bibendum convallis. Nullam vel mi nunc. Duis rutrum odio a magna posuere, in semper nisl dictum. Proin malesuada arcu in mi finibus, eget blandit urna varius. Ut pulvinar malesuada euismod.</p>
|
||||
<p>Suspendisse sed erat neque. Donec est ante, venenatis ut urna a, efficitur finibus leo. Cras ut pellentesque mi. Sed non nunc tincidunt, euismod erat eu, fringilla augue. Nunc in sem a nisi luctus lacinia ut interdum turpis. Pellentesque at bibendum nunc. Etiam id felis in erat egestas ultrices. Proin cursus nulla et ligula elementum iaculis. Aenean volutpat ullamcorper purus, vitae elementum urna interdum at. Aenean ex elit, porta vitae dictum ac, mattis at justo. Aenean non augue tincidunt tellus aliquam condimentum. Nullam eu ante sed turpis lobortis iaculis.</p>
|
||||
</article>
|
1
examples/head-bubbling/src/env.d.ts
vendored
Normal file
1
examples/head-bubbling/src/env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference types="astro/client" />
|
22
examples/head-bubbling/src/pages/index.astro
Normal file
22
examples/head-bubbling/src/pages/index.astro
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
import Post from '../components/Post.astro';
|
||||
---
|
||||
<html>
|
||||
<head>
|
||||
<title>Index page</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: salmon;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>My Site</h1>
|
||||
|
||||
<Post />
|
||||
</body>
|
||||
</html>
|
|
@ -243,6 +243,12 @@ importers:
|
|||
'@astrojs/node': link:../../packages/integrations/node
|
||||
astro: link:../../packages/astro
|
||||
|
||||
examples/head-bubbling:
|
||||
specifiers:
|
||||
astro: ^2.0.11
|
||||
dependencies:
|
||||
astro: link:../../packages/astro
|
||||
|
||||
examples/integration:
|
||||
specifiers:
|
||||
astro: ^2.0.11
|
||||
|
|
Loading…
Reference in a new issue