feat: artefaktuak atala sortzen du
This commit is contained in:
1 parent
6d297f7cbe
commit
60d259a28a
6 files changed
+146
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
---
|
||||
import { getCollection, render } from "astro:content";
|
||||
import Artefaktua from "../../layouts/Artefaktua.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const artefaktuak = await getCollection("artefaktuak");
|
||||
|
||||
return artefaktuak.map((artefaktua) => {
|
||||
return {
|
||||
params: { slug: artefaktua.id },
|
||||
props: { artefaktua: artefaktua },
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
const { artefaktua } = Astro.props;
|
||||
const { Content } = await render(artefaktua);
|
||||
---
|
||||
|
||||
<Artefaktua artefaktua={artefaktua}>
|
||||
<Content />
|
||||
</Artefaktua>
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
import { getCollection } from "astro:content";
|
||||
import BaseHead from "../../components/BaseHead.astro";
|
||||
import Header from "../../components/Header.astro";
|
||||
import Footer from "../../components/Footer.astro";
|
||||
import ColorScript from "../../components/ColorScript.astro";
|
||||
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../../config";
|
||||
import Container from "../../components/Container.astro";
|
||||
|
||||
const artefaktuak = await getCollection("artefaktuak");
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="eu">
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
<body>
|
||||
<Container>
|
||||
<div>
|
||||
<Header />
|
||||
<main>
|
||||
<content>
|
||||
<ul>
|
||||
{
|
||||
artefaktuak.map((artefaktua) => (
|
||||
<li>
|
||||
<a href={`/artefaktua/${artefaktua.id}`}>
|
||||
{artefaktua.data.title}
|
||||
</a>
|
||||
{artefaktua.data.description && (
|
||||
<p>{artefaktua.data.description}</p>
|
||||
)}
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</content>
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
</Container>
|
||||
<ColorScript />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style lang="scss">
|
||||
div {
|
||||
display: grid;
|
||||
grid-template-rows: auto auto 1fr auto;
|
||||
min-height: calc(100dvh - 80px); // body-ak 40px-eko padding-a du
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li {
|
||||
border: 2px solid var(--blue);
|
||||
padding: 0.5em;
|
||||
border-radius: 0.375em;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user