diff options
| author | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2025-03-14 11:07:40 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2025-03-14 11:07:40 +0100 |
| commit | 96b999a3e9c2e4a45897f2015b9fdab3c81962df (patch) | |
| tree | 28f557edeb1a6066ef4ae20f5a66e0b6d1b037b6 /src/pages | |
| parent | ba57248cadf064cf1325b31fd11524b5e5560ee1 (diff) | |
Update dependencies, fix path issues
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/blog/index.astro (renamed from src/pages/blog.astro) | 138 | ||||
| -rw-r--r-- | src/pages/portfolio/index.astro (renamed from src/pages/portfolio.astro) | 4 |
2 files changed, 71 insertions, 71 deletions
diff --git a/src/pages/blog.astro b/src/pages/blog/index.astro index 31920aa..e889706 100644 --- a/src/pages/blog.astro +++ b/src/pages/blog/index.astro @@ -1,69 +1,69 @@ ----
-import { getCollection } from "astro:content";
-import Layout from "../layouts/Layout.astro";
-const blogCollection = (await getCollection("blog")).sort((a, b) => {
- return b.data.publishedAt.getTime() - a.data.publishedAt.getTime();
-});
-const groupedPosts = blogCollection.reduce(
- (acc: Record<string, any[]>, post) => {
- const year = post.data.publishedAt.getFullYear();
- const month = post.data.publishedAt.getMonth() + 1;
- const key = `${year}-${month}`;
- if (!acc[key]) {
- acc[key] = [];
- }
- acc[key].push(post);
- return acc;
- },
- {},
-);
-function humaniseDate(date: Date) {
- const result = date.toLocaleDateString("es-ES", {
- month: "long",
- year: "numeric",
- });
- return result.charAt(0).toUpperCase() + result.slice(1);
-}
-const schema = {
- "@context": "https://schema.org",
- "@type": "Blog",
- "headline": "Blog de Ariel Costas",
- "description": "En este blog encontrarás artículos sobre desarrollo, tecnología y otras temáticas que pueda querer compartir. Disclaimer de siempre: las opiniones son mías, y no representan a ninguna empresa o institución.",
- "publisher": {
- "@type": "Person",
- "name": "Ariel Costas",
- },
- "author": {
- "@type": "Person",
- "name": "Ariel Costas",
- }
-};
-
----
-
-<Layout title="Blog" description="Artículos sobre desarrollo, tecnología y otras temáticas que pueda querer compartir. Disclaimer de siempre: las opiniones son mías, y no representan a ninguna empresa o institución.">
- <script is:inline type="application/ld+json" slot="head-jsonld" set:html={JSON.stringify(schema)}></script>
-
- <h1>Blog de Ariel Costas</h1>
-
- <p>
- En este blog encontrarás artículos sobre desarrollo, tecnología y otras
- temáticas que pueda querer compartir. Disclaimer de siempre: las
- opiniones son mías, y no representan a ninguna empresa o institución.
- </p>
-
- {
- Object.entries(groupedPosts).map(([key, posts]) => (
- <section>
- <h2>{humaniseDate(new Date(key))}</h2>
- <ul>
- {posts.map((post) => (
- <li>
- <a href={`/blog/${post.id}`}>{post.data.title}</a>
- </li>
- ))}
- </ul>
- </section>
- ))
- }
-</Layout>
+--- +import { getCollection } from "astro:content"; +import Layout from "../../layouts/Layout.astro"; +const blogCollection = (await getCollection("blog")).sort((a, b) => { + return b.data.publishedAt.getTime() - a.data.publishedAt.getTime(); +}); +const groupedPosts = blogCollection.reduce( + (acc: Record<string, any[]>, post) => { + const year = post.data.publishedAt.getFullYear(); + const month = post.data.publishedAt.getMonth() + 1; + const key = `${year}-${month}`; + if (!acc[key]) { + acc[key] = []; + } + acc[key].push(post); + return acc; + }, + {}, +); +function humaniseDate(date: Date) { + const result = date.toLocaleDateString("es-ES", { + month: "long", + year: "numeric", + }); + return result.charAt(0).toUpperCase() + result.slice(1); +} +const schema = { + "@context": "https://schema.org", + "@type": "Blog", + "headline": "Blog de Ariel Costas", + "description": "En este blog encontrarás artículos sobre desarrollo, tecnología y otras temáticas que pueda querer compartir. Disclaimer de siempre: las opiniones son mías, y no representan a ninguna empresa o institución.", + "publisher": { + "@type": "Person", + "name": "Ariel Costas", + }, + "author": { + "@type": "Person", + "name": "Ariel Costas", + } +}; + +--- + +<Layout title="Blog" description="Artículos sobre desarrollo, tecnología y otras temáticas que pueda querer compartir. Disclaimer de siempre: las opiniones son mías, y no representan a ninguna empresa o institución."> + <script is:inline type="application/ld+json" slot="head-jsonld" set:html={JSON.stringify(schema)}></script> + + <h1>Blog de Ariel Costas</h1> + + <p> + En este blog encontrarás artículos sobre desarrollo, tecnología y otras + temáticas que pueda querer compartir. Disclaimer de siempre: las + opiniones son mías, y no representan a ninguna empresa o institución. + </p> + + { + Object.entries(groupedPosts).map(([key, posts]) => ( + <section> + <h2>{humaniseDate(new Date(key))}</h2> + <ul> + {posts.map((post) => ( + <li> + <a href={`/blog/${post.id}`}>{post.data.title}</a> + </li> + ))} + </ul> + </section> + )) + } +</Layout> diff --git a/src/pages/portfolio.astro b/src/pages/portfolio/index.astro index 34c14e6..ff80ae8 100644 --- a/src/pages/portfolio.astro +++ b/src/pages/portfolio/index.astro @@ -1,6 +1,6 @@ --- -import Layout from "../layouts/Layout.astro"; -import TechnologyBadge from "../partials/TechnologyBadge.astro"; +import Layout from "../../layouts/Layout.astro"; +import TechnologyBadge from "../../partials/TechnologyBadge.astro"; const schema = { "@context": "https://schema.org", |
