add template in hard
This commit is contained in:
35
front/src/layouts/LandingLayout.astro
Normal file
35
front/src/layouts/LandingLayout.astro
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
import PageLayout from '~/layouts/PageLayout.astro';
|
||||
import Header from '~/components/widgets/Header.astro';
|
||||
|
||||
import { headerData } from '~/navigation';
|
||||
import type { MetaData } from '~/types';
|
||||
|
||||
export interface Props {
|
||||
metadata?: MetaData;
|
||||
}
|
||||
|
||||
const { metadata } = Astro.props;
|
||||
---
|
||||
|
||||
<PageLayout metadata={metadata}>
|
||||
<Fragment slot="announcement">
|
||||
<slot name="announcement" />
|
||||
</Fragment>
|
||||
<Fragment slot="header">
|
||||
<slot name="header">
|
||||
<Header
|
||||
links={headerData?.links[2] ? [headerData.links[2]] : undefined}
|
||||
actions={[
|
||||
{
|
||||
text: 'Download',
|
||||
href: 'https://github.com/onwidget/astrowind',
|
||||
},
|
||||
]}
|
||||
showToggleTheme
|
||||
position="right"
|
||||
/>
|
||||
</slot>
|
||||
</Fragment>
|
||||
<slot />
|
||||
</PageLayout>
|
@ -1,51 +1,54 @@
|
||||
---
|
||||
interface Props {
|
||||
title: string;
|
||||
import '~/assets/styles/tailwind.css';
|
||||
|
||||
import { I18N } from 'astrowind:config';
|
||||
|
||||
import CommonMeta from '~/components/common/CommonMeta.astro';
|
||||
import Favicons from '~/components/Favicons.astro';
|
||||
import CustomStyles from '~/components/CustomStyles.astro';
|
||||
import ApplyColorMode from '~/components/common/ApplyColorMode.astro';
|
||||
import Metadata from '~/components/common/Metadata.astro';
|
||||
import SiteVerification from '~/components/common/SiteVerification.astro';
|
||||
import Analytics from '~/components/common/Analytics.astro';
|
||||
import BasicScripts from '~/components/common/BasicScripts.astro';
|
||||
|
||||
// Comment the line below to disable View Transitions
|
||||
import { ViewTransitions } from 'astro:transitions';
|
||||
|
||||
import type { MetaData as MetaDataType } from '~/types';
|
||||
|
||||
export interface Props {
|
||||
metadata?: MetaDataType;
|
||||
}
|
||||
|
||||
const { title } = Astro.props;
|
||||
const { metadata = {} } = Astro.props;
|
||||
const { language, textDirection } = I18N;
|
||||
---
|
||||
|
||||
<!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>{title}</title>
|
||||
</head>
|
||||
<body>
|
||||
<slot />
|
||||
</body>
|
||||
<html lang={language} dir={textDirection} class="2xl:text-[20px]">
|
||||
<head>
|
||||
<CommonMeta />
|
||||
<Favicons />
|
||||
<CustomStyles />
|
||||
<ApplyColorMode />
|
||||
<Metadata {...metadata} />
|
||||
<SiteVerification />
|
||||
<Analytics />
|
||||
|
||||
<!-- Comment the line below to disable View Transitions -->
|
||||
<ViewTransitions fallback="swap" />
|
||||
</head>
|
||||
|
||||
<body class="antialiased text-default bg-page tracking-tight">
|
||||
<slot />
|
||||
|
||||
<BasicScripts />
|
||||
|
||||
<style is:global>
|
||||
img {
|
||||
content-visibility: auto;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
<style is:global>
|
||||
:root {
|
||||
--accent: 136, 58, 234;
|
||||
--accent-light: 224, 204, 250;
|
||||
--accent-dark: 49, 10, 101;
|
||||
--accent-gradient: linear-gradient(
|
||||
45deg,
|
||||
rgb(var(--accent)),
|
||||
rgb(var(--accent-light)) 30%,
|
||||
white 60%
|
||||
);
|
||||
}
|
||||
html {
|
||||
font-family: system-ui, sans-serif;
|
||||
background: #13151a;
|
||||
background-size: 224px;
|
||||
}
|
||||
code {
|
||||
font-family:
|
||||
Menlo,
|
||||
Monaco,
|
||||
Lucida Console,
|
||||
Liberation Mono,
|
||||
DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono,
|
||||
Courier New,
|
||||
monospace;
|
||||
}
|
||||
</style>
|
||||
|
28
front/src/layouts/MarkdownLayout.astro
Normal file
28
front/src/layouts/MarkdownLayout.astro
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
import Layout from '~/layouts/PageLayout.astro';
|
||||
|
||||
import type { MetaData } from '~/types';
|
||||
|
||||
export interface Props {
|
||||
frontmatter: {
|
||||
title?: string;
|
||||
};
|
||||
}
|
||||
|
||||
const { frontmatter } = Astro.props;
|
||||
|
||||
const metadata: MetaData = {
|
||||
title: frontmatter?.title,
|
||||
};
|
||||
---
|
||||
|
||||
<Layout metadata={metadata}>
|
||||
<section class="px-4 py-16 sm:px-6 mx-auto lg:px-8 lg:py-20 max-w-4xl">
|
||||
<h1 class="font-bold font-heading text-4xl md:text-5xl leading-tighter tracking-tighter">{frontmatter.title}</h1>
|
||||
<div
|
||||
class="mx-auto prose prose-lg max-w-4xl dark:prose-invert dark:prose-headings:text-slate-300 prose-md prose-headings:font-heading prose-headings:leading-tighter prose-headings:tracking-tighter prose-headings:font-bold prose-a:text-blue-600 dark:prose-a:text-blue-400 prose-img:rounded-md prose-img:shadow-lg mt-8"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</section>
|
||||
</Layout>
|
31
front/src/layouts/PageLayout.astro
Normal file
31
front/src/layouts/PageLayout.astro
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
import Layout from '~/layouts/Layout.astro';
|
||||
import Header from '~/components/widgets/Header.astro';
|
||||
import Footer from '~/components/widgets/Footer.astro';
|
||||
import Announcement from '~/components/widgets/Announcement.astro';
|
||||
|
||||
import { headerData, footerData } from '~/navigation';
|
||||
|
||||
import type { MetaData } from '~/types';
|
||||
|
||||
export interface Props {
|
||||
metadata?: MetaData;
|
||||
}
|
||||
|
||||
const { metadata } = Astro.props;
|
||||
---
|
||||
|
||||
<Layout metadata={metadata}>
|
||||
<slot name="announcement">
|
||||
<Announcement />
|
||||
</slot>
|
||||
<slot name="header">
|
||||
<Header {...headerData} isSticky showRssFeed showToggleTheme />
|
||||
</slot>
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
<slot name="footer">
|
||||
<Footer {...footerData} />
|
||||
</slot>
|
||||
</Layout>
|
Reference in New Issue
Block a user