chore: remove old /blog/ pages (replaced by /md/)
This commit is contained in:
parent
f769f15468
commit
a3b63f9c85
2 changed files with 0 additions and 47 deletions
|
|
@ -1,22 +0,0 @@
|
||||||
---
|
|
||||||
import { getCollection, render } from 'astro:content';
|
|
||||||
import Layout from '../../layouts/Layout.astro';
|
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
|
||||||
const posts = await getCollection('posts');
|
|
||||||
return posts.map(post => ({
|
|
||||||
params: { slug: post.id },
|
|
||||||
props: { post }
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
const { post } = Astro.props;
|
|
||||||
const { Content } = await render(post);
|
|
||||||
---
|
|
||||||
<Layout title={`${post.data.title} - lewis m.w.`}>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<h1>{post.data.title}</h1>
|
|
||||||
<Content />
|
|
||||||
</article>
|
|
||||||
</Layout>
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
---
|
|
||||||
import { getCollection } from 'astro:content';
|
|
||||||
import Layout from '../../layouts/Layout.astro';
|
|
||||||
|
|
||||||
const posts = await getCollection('posts');
|
|
||||||
const sorted = posts.sort((a, b) => {
|
|
||||||
if (a.data.pinned && !b.data.pinned) return -1;
|
|
||||||
if (!a.data.pinned && b.data.pinned) return 1;
|
|
||||||
return b.data.date.getTime() - a.data.date.getTime();
|
|
||||||
});
|
|
||||||
|
|
||||||
function formatDate(date: Date): string {
|
|
||||||
const d = String(date.getDate()).padStart(2, '0');
|
|
||||||
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const y = String(date.getFullYear()).slice(-2);
|
|
||||||
return `${d}/${m}/${y}`;
|
|
||||||
}
|
|
||||||
---
|
|
||||||
<Layout title="blog - lewis m.w.">
|
|
||||||
|
|
||||||
<details open>
|
|
||||||
<summary>blog</summary>
|
|
||||||
<pre set:html={sorted.map(post => `<span class="muted">${formatDate(post.data.date)}</span> <a href="/blog/${post.id}">${post.data.title}</a>${post.data.pinned ? ' [pinned]' : ''}`).join('\n')} />
|
|
||||||
</details>
|
|
||||||
</Layout>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue