Dinamically generate blog indexes
This commit is contained in:
parent
1cb4b098f4
commit
3beeec63be
Binary file not shown.
@ -1,26 +1,31 @@
|
|||||||
---
|
---
|
||||||
import BlogLayout from "../../../layouts/BlogLayout.astro";
|
import BlogLayout from "../../../layouts/BlogLayout.astro";
|
||||||
|
|
||||||
|
const allPosts = await Astro.glob("./*.md");
|
||||||
---
|
---
|
||||||
|
|
||||||
<BlogLayout>
|
<BlogLayout>
|
||||||
<h1>Blog index, WIP</h1>
|
<p>
|
||||||
|
My thoughts on many tech things, on english. This content may (will)
|
||||||
<p>Some day there will be a procedurally generated list of pages here!</p>
|
differ from what I wrote in Spanish.
|
||||||
|
</p>
|
||||||
<p>Until then:</p>
|
|
||||||
|
|
||||||
<p>Posts:</p>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
{
|
||||||
|
allPosts
|
||||||
|
.toSorted((x, y) =>
|
||||||
|
x.frontmatter.pubDate > y.frontmatter.pubDate ? -1 : 1,
|
||||||
|
)
|
||||||
|
.map((post) => {
|
||||||
|
return (
|
||||||
<li>
|
<li>
|
||||||
<a class="underline" href="/blog/en/responsible-stack/">
|
{post.frontmatter.pubDate} -
|
||||||
The responsible stack
|
<a class="underline" href={post.url}>
|
||||||
</a>
|
{post.frontmatter.title}
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a class="underline" href="/blog/en/go-1/">
|
|
||||||
Golang first impressions
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</BlogLayout>
|
</BlogLayout>
|
||||||
|
@ -10,11 +10,11 @@ image:
|
|||||||
caption: ThePrimeagen & Theo, as depicted by the author.
|
caption: ThePrimeagen & Theo, as depicted by the author.
|
||||||
---
|
---
|
||||||
|
|
||||||
> TLDR: There's a theoretical "responsible" tech stack that would
|
> TL;DR: There's a theoretical "responsible" tech stack that would
|
||||||
> ...
|
> minimize expenses for a company building a product.
|
||||||
|
|
||||||
At my first job I worked at a small shop, as "the computer guy". I did
|
At my first job I worked at a small shop, as "the computer guy". I did
|
||||||
everything, from converting word files to `pdf`, to mantain 10 years old
|
everything, from converting word files to `pdf` to mantaining 10 years old
|
||||||
legacy PHP webpages, to implementing internal systems.
|
legacy PHP webpages, to implementing internal systems.
|
||||||
I was the only IT guy, there were around 5-10 call center people and
|
I was the only IT guy, there were around 5-10 call center people and
|
||||||
the boss only came like 3 times a week.
|
the boss only came like 3 times a week.
|
||||||
|
@ -1,24 +1,32 @@
|
|||||||
---
|
---
|
||||||
import BlogLayout from "../../../layouts/BlogLayout.astro";
|
import BlogLayout from "../../../layouts/BlogLayout.astro";
|
||||||
|
|
||||||
|
const allPosts = await Astro.glob("./*.md");
|
||||||
---
|
---
|
||||||
|
|
||||||
<BlogLayout lang="es">
|
<BlogLayout lang="es">
|
||||||
<h1>Blog en Español</h1>
|
<p>
|
||||||
|
Pienso, therefore escribo un blog post en español.
|
||||||
<p>Carita feliz :D</p>
|
<br>
|
||||||
|
Estos post son diferentes a lo que escribo en ingles.
|
||||||
<p>Posts:</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
{
|
||||||
|
allPosts
|
||||||
|
.toSorted((x, y) =>
|
||||||
|
x.frontmatter.pubDate > y.frontmatter.pubDate ? -1 : 1,
|
||||||
|
)
|
||||||
|
.map((post) => {
|
||||||
|
return (
|
||||||
<li>
|
<li>
|
||||||
<a class="underline" href="/blog/responsible-stack/">
|
{post.frontmatter.pubDate} -
|
||||||
The responsible stack
|
<a class="underline" href={post.url}>
|
||||||
</a>
|
{post.frontmatter.title}
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a class="underline" href="/blog/go-1/">
|
|
||||||
Golang first impressions
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</BlogLayout>
|
</BlogLayout>
|
13
src/pages/blog/es/intro.md
Normal file
13
src/pages/blog/es/intro.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
layout: ../../../layouts/BlogLayout.astro
|
||||||
|
title: Primera pagina
|
||||||
|
description: Hola mundo :D
|
||||||
|
pubDate: "2024-07-15"
|
||||||
|
tags: ["programming"]
|
||||||
|
image:
|
||||||
|
url: ""
|
||||||
|
alt: ""
|
||||||
|
caption: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
(carita feliz)
|
Loading…
Reference in New Issue
Block a user