refactor: rename layouts for App & Blog
This commit is contained in:
parent
aa271c8050
commit
ebf7baa1ed
5 changed files with 20 additions and 34 deletions
|
@ -51,17 +51,15 @@ const appTitle = article?.title ? `${article.title} | Cozy` : 'Cozy';
|
|||
<body>
|
||||
<div id="app-wrapper">
|
||||
<Jumbotron />
|
||||
<main>
|
||||
<slot />
|
||||
<div id="main-content">
|
||||
<div id="post-wrapper">
|
||||
<slot name="post" />
|
||||
</div>
|
||||
<div id="library-wrapper">
|
||||
<slot name="library" />
|
||||
</div>
|
||||
<slot />
|
||||
<div id="main-content">
|
||||
<div id="post-wrapper">
|
||||
<slot name="post" />
|
||||
</div>
|
||||
</main>
|
||||
<div id="library-wrapper">
|
||||
<slot name="library" />
|
||||
</div>
|
||||
</div>
|
||||
<slot name="footer" />
|
||||
</div>
|
||||
</body>
|
||||
|
@ -75,11 +73,9 @@ const appTitle = article?.title ? `${article.title} | Cozy` : 'Cozy';
|
|||
}
|
||||
|
||||
#app-wrapper {
|
||||
width: 100%;
|
||||
max-width: 650px;
|
||||
padding: 0.5rem;
|
||||
padding-bottom: 5em;
|
||||
|
||||
padding: 0 0.5em 10em;
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
|
||||
&:has(#router-outlet #post) {
|
||||
#jumbotron {
|
||||
|
@ -87,16 +83,6 @@ const appTitle = article?.title ? `${article.title} | Cozy` : 'Cozy';
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#main-content {
|
||||
* {
|
||||
margin: 1rem 0 0;
|
||||
}
|
||||
|
||||
#post-wrapper {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style is:global>
|
||||
:root {
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import App from "../layouts/App.astro";
|
||||
import Library from "../components/Library.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import SimpleAddressBar from "../components/SimpleAddressBar.astro";
|
||||
|
@ -8,7 +8,7 @@ export const prerender = false;
|
|||
|
||||
---
|
||||
|
||||
<Layout article={null}>
|
||||
<App article={null}>
|
||||
<SimpleAddressBar url='' />
|
||||
<div slot="post" id="router-outlet">
|
||||
<h1>
|
||||
|
@ -17,4 +17,4 @@ export const prerender = false;
|
|||
</div>
|
||||
<Library slot="library" skipSave />
|
||||
<Footer slot="footer" />
|
||||
</Layout>
|
||||
</App>
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import { type CollectionEntry, getCollection } from 'astro:content';
|
||||
import BlogPost from '../../layouts/BlogPost.astro';
|
||||
import Blog from '../../layouts/Blog.astro';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
|
@ -15,6 +15,6 @@ const post = Astro.props;
|
|||
const { Content } = await post.render();
|
||||
---
|
||||
|
||||
<BlogPost {...post.data}>
|
||||
<Blog {...post.data}>
|
||||
<Content />
|
||||
</BlogPost>
|
||||
</Blog>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { ArticleData, extract } from "@extractus/article-extractor";
|
||||
import SimpleAddressBar from "../components/SimpleAddressBar.astro";
|
||||
import Post from "../components/Post.astro";
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import App from "../layouts/App.astro";
|
||||
import Library from "../components/Library.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
|
||||
|
@ -23,11 +23,11 @@ if (url)
|
|||
}
|
||||
|
||||
---
|
||||
<Layout article={article}>
|
||||
<App article={article}>
|
||||
<SimpleAddressBar url={url} />
|
||||
<div slot="post" id="router-outlet">
|
||||
<Post article={article} />
|
||||
</div>
|
||||
<Library slot="library" skipSave={article === null} />
|
||||
<Footer slot="footer" />
|
||||
</Layout>
|
||||
</App>
|
||||
|
|
Loading…
Reference in a new issue