Dinamically generate blog indexes

main
Araozu 2024-07-15 09:50:00 -05:00
parent 1cb4b098f4
commit 3beeec63be
5 changed files with 62 additions and 36 deletions

Binary file not shown.

View File

@ -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>
<li> {
<a class="underline" href="/blog/en/responsible-stack/"> allPosts
The responsible stack .toSorted((x, y) =>
</a> x.frontmatter.pubDate > y.frontmatter.pubDate ? -1 : 1,
</li> )
<li> .map((post) => {
<a class="underline" href="/blog/en/go-1/"> return (
Golang first impressions <li>
</a> {post.frontmatter.pubDate} -
</li> <a class="underline" href={post.url}>
{post.frontmatter.title}
</a>
</li>
);
})
}
</ul> </ul>
</BlogLayout> </BlogLayout>

View File

@ -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.

View File

@ -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>
<li> {
<a class="underline" href="/blog/responsible-stack/"> allPosts
The responsible stack .toSorted((x, y) =>
</a> x.frontmatter.pubDate > y.frontmatter.pubDate ? -1 : 1,
</li> )
<li> .map((post) => {
<a class="underline" href="/blog/go-1/"> return (
Golang first impressions <li>
</a> {post.frontmatter.pubDate} -
</li> <a class="underline" href={post.url}>
{post.frontmatter.title}
</a>
</li>
);
})
}
</ul> </ul>
</BlogLayout> </BlogLayout>

View 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)