start frontend, adding layouts for things
This commit is contained in:
15
src/component/core/head.astro
Normal file
15
src/component/core/head.astro
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
const {
|
||||||
|
title
|
||||||
|
} = Astro.props
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
<title>{title}</title>
|
||||||
|
</head>
|
||||||
18
src/component/core/layout.astro
Normal file
18
src/component/core/layout.astro
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
import Head from "./head.astro";
|
||||||
|
|
||||||
|
const {
|
||||||
|
title = "Memento"
|
||||||
|
} = Astro.props
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<Head
|
||||||
|
title={title}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<slot />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import "../styles/global.css"
|
import "../styles/global.css"
|
||||||
|
import Layout from "../component/core/layout.astro"
|
||||||
---
|
---
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -43,16 +44,8 @@ import "../styles/global.css"
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<html lang="en">
|
<Layout>
|
||||||
<head>
|
<h1>Astro</h1>
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
<meta name="generator" content={Astro.generator} />
|
|
||||||
<title>Astro</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Astro</h1>
|
|
||||||
<div id="editor">
|
<div id="editor">
|
||||||
<p>Hello World!</p>
|
<p>Hello World!</p>
|
||||||
<p>Some initial <strong>bold</strong> text</p>
|
<p>Some initial <strong>bold</strong> text</p>
|
||||||
@@ -69,5 +62,4 @@ import "../styles/global.css"
|
|||||||
<div id="result">
|
<div id="result">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</Layout>
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user