doing basic layout
This commit is contained in:
17
web/src/layout/Base.astro
Normal file
17
web/src/layout/Base.astro
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
import BaseHead from "./BaseHead.astro"
|
||||
---
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<BaseHead/>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main id="main" class="flex-1">
|
||||
<slot />
|
||||
</main>
|
||||
<!-- <Footer /> -->
|
||||
</body>
|
||||
</html>
|
||||
53
web/src/layout/BaseHead.astro
Normal file
53
web/src/layout/BaseHead.astro
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
import "../styles/global.css";
|
||||
|
||||
const { title, description, ogImage, articleDate } = Astro.props;
|
||||
import { siteConfig } from "src/site.config";
|
||||
|
||||
const siteTitle = `${title}@breadone`;
|
||||
// const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||
const socialImageURL = new URL(ogImage ? ogImage : "/icon.png", Astro.url).href;
|
||||
---
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
|
||||
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>{siteTitle}</title>
|
||||
<meta name="title" content={siteTitle} />
|
||||
<meta name="description" content={description} />
|
||||
<meta name="author" content={siteConfig.author} />
|
||||
|
||||
<!-- Theme Colour -->
|
||||
<meta name="theme-color" content={siteConfig.themeColorLight} />
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:type" content={articleDate ? "article" : "website"} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<!-- <meta property="og:url" content={canonicalURL} /> -->
|
||||
<meta property="og:site_name" content={siteConfig.title} />
|
||||
<meta property="og:locale" content={siteConfig.ogLocale} />
|
||||
<meta property="og:image" content={socialImageURL} />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
{
|
||||
articleDate && (
|
||||
<>
|
||||
<meta property="article:author" content={siteConfig.author} />
|
||||
<meta property="article:published_time" content={articleDate} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<!-- <meta property="twitter:url" content={canonicalURL} /> -->
|
||||
<meta property="twitter:title" content={title} />
|
||||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={socialImageURL} />
|
||||
|
||||
<!-- RSS auto-discovery -->
|
||||
<!-- <link rel="alternate" type="application/rss+xml" title={siteConfig.title} href="/rss.xml" /> -->
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
import Base from "src/layout/Base.astro"
|
||||
---
|
||||
|
||||
---
|
||||
<Base>
|
||||
<div class="flex flex-row">
|
||||
<!-- HeaderSection -->
|
||||
|
||||
<html lang="en">
|
||||
<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>Astro</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Astro</h1>
|
||||
</body>
|
||||
</html>
|
||||
<div class="w-[32%] bg-amber-400">
|
||||
breadone dot net
|
||||
</div>
|
||||
|
||||
<div class="w-[68%] bg-blue-400">
|
||||
content
|
||||
</div>
|
||||
</div>
|
||||
</Base>
|
||||
|
||||
19
web/src/site.config.ts
Normal file
19
web/src/site.config.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
interface SiteConfig {
|
||||
author: string;
|
||||
title: string;
|
||||
description: string;
|
||||
lang: string;
|
||||
ogLocale: string;
|
||||
themeColorLight: string;
|
||||
themeColorDark: string;
|
||||
}
|
||||
|
||||
export const siteConfig: SiteConfig = {
|
||||
author: "breadone",
|
||||
title: "@breadone",
|
||||
description: "Tha Breadsite",
|
||||
lang: "en-GB",
|
||||
ogLocale: "en_GB",
|
||||
themeColorLight: "#f4f4f9",
|
||||
themeColorDark: "#1d1f21",
|
||||
};
|
||||
5
web/src/styles/global.css
Normal file
5
web/src/styles/global.css
Normal file
@@ -0,0 +1,5 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
html body {
|
||||
@apply w-[61%] mx-auto h-full font-[Georgia]
|
||||
}
|
||||
Reference in New Issue
Block a user