From 7bb2917fa8c6ba34ef1a6121f719f06e47e740de Mon Sep 17 00:00:00 2001 From: jamerrq Date: Mon, 22 Jan 2024 19:43:52 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20feat:=20blog=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/lib/svgs/astro-logo-light-gradient.svg | 16 + src/components/badges/open-to-work.astro | 4 +- src/components/badges/read-time.astro | 15 + src/components/blog/last-entries.tsx | 56 +++- src/components/css-peeps/peep.astro | 2 +- src/components/icons/copy.astro | 2 +- src/components/icons/copyright.astro | 5 +- src/components/icons/go-back.astro | 2 +- src/components/icons/home.astro | 2 +- src/components/icons/moon.astro | 2 +- src/components/icons/shuffle.astro | 2 +- src/components/icons/sun.astro | 18 +- src/components/icons/translator.astro | 2 +- src/components/main/about-me-card.astro | 2 +- src/components/main/background.astro | 2 +- src/components/main/bento.astro | 4 +- src/components/main/blur-background.astro | 2 +- src/components/main/spinner.astro | 4 +- src/data/blog.json | 11 +- src/data/resources.json | 4 + src/layouts/blog-layout.astro | 11 +- src/pages/404.astro | 4 +- src/pages/blog/building-this-website.md | 293 +++++++++++++----- src/pages/board.astro | 2 +- src/pages/es/blog/acerca-de-esta-web.md | 257 +++++++++++++++ src/utils/index.ts | 12 +- tailwind.config.mjs | 17 + 27 files changed, 636 insertions(+), 117 deletions(-) create mode 100644 public/lib/svgs/astro-logo-light-gradient.svg create mode 100644 src/components/badges/read-time.astro create mode 100644 src/pages/es/blog/acerca-de-esta-web.md diff --git a/public/lib/svgs/astro-logo-light-gradient.svg b/public/lib/svgs/astro-logo-light-gradient.svg new file mode 100644 index 0000000..2d2c4fa --- /dev/null +++ b/public/lib/svgs/astro-logo-light-gradient.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/components/badges/open-to-work.astro b/src/components/badges/open-to-work.astro index effc2e1..35d505d 100644 --- a/src/components/badges/open-to-work.astro +++ b/src/components/badges/open-to-work.astro @@ -6,9 +6,9 @@ const { lang = 'en' }: Props = Astro.props --- - + + + diff --git a/src/components/blog/last-entries.tsx b/src/components/blog/last-entries.tsx index 130d9c8..0697181 100644 --- a/src/components/blog/last-entries.tsx +++ b/src/components/blog/last-entries.tsx @@ -21,13 +21,57 @@ const LAST_ENTRIES_STYLES = [ 'text-slate-900', 'dark:text-slate-300', 'py-4', - 'px-2', + 'px-2' ].join(' ') import { entries } from '@data/blog.json' import { Fragment } from 'preact' +function ReadTimeBadge({ + readTime, + lang = 'en' +}: { + readTime: string | undefined + lang?: string +}) { + if (!readTime) return null + return ( + + + {readTime} {lang === 'en' ? 'min read' : 'min de lectura'} + + ) +} + +function Badges({ badges }: { badges?: string[] }) { + if (!badges) return null + return ( +
+ {badges.map((badge, index) => ( + + ))} +
+ ) +} + +function GenericBadge({ text }: { text: string }) { + return ( + + {text} + + ) +} + export default function LastEntries({ lang = 'en' }: { lang?: string }) { return (
@@ -36,17 +80,21 @@ export default function LastEntries({ lang = 'en' }: { lang?: string }) {