chore: tipadoa konpontzen du
This commit is contained in:
1 parent
a866661a82
commit
3b47191d78
6 files changed
+65
-58
No files matched your search
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { CollectionEntry, getCollection, render } from "astro:content";
|
||||
import { type CollectionEntry, getCollection, render } from "astro:content";
|
||||
import BlogPost from "../../layouts/BlogPost.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
|
||||
+16
-23
@@ -11,32 +11,25 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../../config";
|
||||
let posts = await getCollection("posts");
|
||||
|
||||
posts = posts.sort(
|
||||
(a, b) =>
|
||||
new Date(b.data.updated || b.data.added).valueOf() -
|
||||
new Date(a.data.updated || a.data.added).valueOf(),
|
||||
(a, b) =>
|
||||
new Date(b.data.updated || b.data.added).valueOf() -
|
||||
new Date(a.data.updated || a.data.added).valueOf(),
|
||||
);
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="eu">
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<content>
|
||||
<ul class="posts-list">
|
||||
{
|
||||
posts.map(
|
||||
({
|
||||
url,
|
||||
data: { description, slug, title, tags, added: date },
|
||||
}) => <Post {description} {date} {slug} {title} {tags} />
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
</content>
|
||||
</main>
|
||||
<Footer />
|
||||
<ColorScript />
|
||||
</body>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<content>
|
||||
<ul class="posts-list">
|
||||
{posts.map((post) => <Post post={post} />)}
|
||||
</ul>
|
||||
</content>
|
||||
</main>
|
||||
<Footer />
|
||||
<ColorScript />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, type CollectionEntry } from "astro:content";
|
||||
import BaseHead from "../../components/BaseHead.astro";
|
||||
import Header from "../../components/Header.astro";
|
||||
import Footer from "../../components/Footer.astro";
|
||||
@@ -9,8 +9,8 @@ import ColorScript from "../../components/ColorScript.astro";
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../../config";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
let posts = await getCollection("posts");
|
||||
const tags = posts.reduce((allTags, post) => {
|
||||
const posts = await getCollection("posts");
|
||||
const tags = posts.reduce<Record<string, CollectionEntry<"posts">[]>>((allTags, post) => {
|
||||
const postTags = post.data.tags;
|
||||
if (postTags) {
|
||||
postTags.forEach((tag) => {
|
||||
@@ -50,10 +50,7 @@ let sortedPosts = tag.sort(
|
||||
<ul class="tags-list">
|
||||
{
|
||||
sortedPosts.map(
|
||||
({
|
||||
url,
|
||||
data: { description, slug, title, tags, added: date },
|
||||
}) => <Post {url} {description} {date} {slug} {title} {tags} />
|
||||
(post) => <Post post={post} />
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user