Old Astro setup
This commit is contained in:
9
src/components/Card.astro
Normal file
9
src/components/Card.astro
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
import Heading from "./Heading.astro";
|
||||
---
|
||||
|
||||
<div class="card p-6 border-white border-[1px] border-opacity-10 bg-slate-300 bg-opacity-5 rounded-xl">
|
||||
<Heading tag="h2">
|
||||
Test
|
||||
</Heading>
|
||||
</div>
|
||||
23
src/components/Heading.astro
Normal file
23
src/components/Heading.astro
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
interface Props {
|
||||
tag: 'h1' | 'h2' | 'h3';
|
||||
}
|
||||
|
||||
const { tag = "h1" } = Astro.props;
|
||||
---
|
||||
|
||||
{tag === 'h1' &&
|
||||
<h1 class="font-heading text-5xl font-bold">
|
||||
<slot />
|
||||
</h1>
|
||||
}
|
||||
{tag === 'h2' &&
|
||||
<h1 class="font-heading text-3xl font-bold">
|
||||
<slot />
|
||||
</h1>
|
||||
}
|
||||
{tag === 'h3' &&
|
||||
<h1 class="font-heading text-xl font-bold">
|
||||
<slot />
|
||||
</h1>
|
||||
}
|
||||
1
src/env.d.ts
vendored
Normal file
1
src/env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="astro/client" />
|
||||
42
src/layouts/Layout.astro
Normal file
42
src/layouts/Layout.astro
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
import '../../assets/css/main.css';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const { title } = Astro.props;
|
||||
|
||||
let renderedTitle
|
||||
const baseTitle = 'Alexis Pelé - Ingénieur web breton'
|
||||
|
||||
if (title) {
|
||||
renderedTitle = `${title} · ${baseTitle}`
|
||||
} else {
|
||||
renderedTitle = baseTitle
|
||||
}
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="Astro description">
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={ Astro.generator } />
|
||||
|
||||
<title>{ renderedTitle }</title>
|
||||
</head>
|
||||
|
||||
<body class="bg-stone-50">
|
||||
<div class="container transition-all">
|
||||
<div class="h-screen py-12 px-24 shadow-sm bg-white">
|
||||
<div class="mt-32">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
11
src/pages/index.astro
Normal file
11
src/pages/index.astro
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<main>
|
||||
<h1 class="text-4xl font-bold">
|
||||
Titre
|
||||
</h1>
|
||||
</main>
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user