init
This commit is contained in:
57
src/layouts/Layout.astro
Normal file
57
src/layouts/Layout.astro
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
import Meta from './Meta.astro';
|
||||
import TopBg from "@/components/ui/TopBg.astro";
|
||||
import Footer from "@/components/sections/Footer.astro";
|
||||
import Header from "@/components/sections/Header.astro";
|
||||
import TrackGa from "@/components/widgets/TrackGa.astro";
|
||||
interface Props {
|
||||
title?: string | undefined;
|
||||
description?: string | undefined;
|
||||
keywords?: string | undefined;
|
||||
}
|
||||
|
||||
const {
|
||||
title,
|
||||
description,
|
||||
keywords
|
||||
} = Astro.props;
|
||||
|
||||
|
||||
import "../styles/global.css";
|
||||
import "aos/dist/aos.css";
|
||||
import "../styles/aos-custom.css";
|
||||
import '../styles/article.css';
|
||||
import '../styles/article-enhancements.css';
|
||||
---
|
||||
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<Meta
|
||||
title = {title}
|
||||
description = {description}
|
||||
keywords = {keywords}
|
||||
/>
|
||||
<TrackGa />
|
||||
<!-- Used to add dark mode right away, adding here prevents any flicker -->
|
||||
<script is:inline>
|
||||
if (typeof Storage !== 'undefined') {
|
||||
if (
|
||||
localStorage.getItem('dark_mode') &&
|
||||
localStorage.getItem('dark_mode') == 'true'
|
||||
) {
|
||||
document.documentElement.classList.add('dark')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.png" />
|
||||
</head>
|
||||
<body class="antialiased bg-bg-primary dark:bg-bg-primary-dark max-w-full overflow-x-hidden">
|
||||
<TopBg />
|
||||
<Header />
|
||||
<slot />
|
||||
<Footer />
|
||||
<script src="../assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
46
src/layouts/Meta.astro
Normal file
46
src/layouts/Meta.astro
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
import { siteConfig } from '@/config/site.js';
|
||||
export interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
keywords?: string;
|
||||
url?: string;
|
||||
ogImage?: string;
|
||||
twitterHandle?: string;
|
||||
}
|
||||
|
||||
const {
|
||||
title,
|
||||
description,
|
||||
keywords = "",
|
||||
url = siteConfig.url, //
|
||||
ogImage = "/og.jpg",
|
||||
twitterHandle = siteConfig.social.twitterName || '',
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
<!-- Meta Tags -->
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
<meta name="keywords" content={keywords} />
|
||||
<meta name="author" content="ricoui.com" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
|
||||
<!-- Open Graph Tags -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={url} />
|
||||
<meta property="og:image" content={ogImage} />
|
||||
<meta property="og:site_name" content={title} />
|
||||
|
||||
<!-- Twitter Meta Tags -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={ogImage} />
|
||||
<meta name="twitter:site" content={twitterHandle} />
|
||||
<meta name="twitter:creator" content={twitterHandle} />
|
||||
15
src/layouts/PageLayout.astro
Normal file
15
src/layouts/PageLayout.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import Layout from "@/layouts/Layout.astro";
|
||||
interface Props {
|
||||
title?: string | undefined;
|
||||
keywords?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}
|
||||
const { title, description,keywords} = Astro.props;
|
||||
---
|
||||
|
||||
<Layout title={title} description={description} keywords={keywords}>
|
||||
<main class="post-wrapper">
|
||||
<slot />
|
||||
</main>
|
||||
</Layout>
|
||||
16
src/layouts/PostLayout.astro
Normal file
16
src/layouts/PostLayout.astro
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
import Layout from "@/layouts/Layout.astro";
|
||||
|
||||
interface Props {
|
||||
title?: string | undefined;
|
||||
keywords?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}
|
||||
const { title, description,keywords} = Astro.props;
|
||||
---
|
||||
|
||||
<Layout title={title} description={description} keywords={keywords}>
|
||||
<main class="post-wrapper">
|
||||
<slot />
|
||||
</main>
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user