From 5038c8c6a1562e4a80163c34184490a1c5df997c Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 12 Mar 2026 19:39:59 +0800 Subject: [PATCH] Updated --- src/content/articles/lets-make-this.md | 3 +- src/pages/read/5-tech-icons.astro | 20 ------------ src/pages/read/[article].astro | 42 ++++++++------------------ 3 files changed, 15 insertions(+), 50 deletions(-) delete mode 100644 src/pages/read/5-tech-icons.astro diff --git a/src/content/articles/lets-make-this.md b/src/content/articles/lets-make-this.md index e7abe26..0aafb04 100644 --- a/src/content/articles/lets-make-this.md +++ b/src/content/articles/lets-make-this.md @@ -4,6 +4,7 @@ title: "Let’s Make This Hello World Joke More Interesting" subtitle: "hello_world(“print”)" date: "Sep 23, 2024" minutes: 8 -url: "read/lets-make-this.astro" +url: "read/lets-make-this" --- +An icon is a small image or symbol used to represent a concept, idea, or, in this case, a function or a technological indication. And digital icons are found everywhere, especially on software and website designs. Thanks to online resources like Material Fonts, Flaticon, Font Awesome, and many more. \ No newline at end of file diff --git a/src/pages/read/5-tech-icons.astro b/src/pages/read/5-tech-icons.astro deleted file mode 100644 index 83e74de..0000000 --- a/src/pages/read/5-tech-icons.astro +++ /dev/null @@ -1,20 +0,0 @@ ---- -import Layout from '../../layouts/Layout.astro' -import * as fiveTech from '../../content/articles/5-tech-icons.md' -import Article from '../../components/Article.astro' - -const title = fiveTech.frontmatter.title -const content = await fiveTech.compiledContent() ---- - - -
-
-
-
- - diff --git a/src/pages/read/[article].astro b/src/pages/read/[article].astro index ae43ffd..15deb6b 100644 --- a/src/pages/read/[article].astro +++ b/src/pages/read/[article].astro @@ -1,42 +1,26 @@ --- import Layout from '../../layouts/Layout.astro' -// import Article from '../../components/Article.astro' - -import { Picture } from 'astro:assets' - -import * as fiveTech from '../../content/articles/5-tech-icons.md' -import * as letsMake from '../../content/articles/lets-make-this.md' +import ArticleComponent from '../../components/Article.astro' export async function getStaticPaths() { - // const articles: any = await Astro.glob('../../content/articles/*.md') - // const paths = articles.map((article: any) => ({ params: { story: article.frontmatter.slug } })) - // return paths - return [{ params: { article: '5-tech-icons' } }, { params: { article: 'lets-make-this' } }] + const articles: any = await Astro.glob('../../content/articles/*.md') + const paths = articles.map((article: any) => ({ + params: { article: article.frontmatter.slug }, + })) + return paths } + const { article } = Astro.params -let title = '' -let content = '' - -if (article === fiveTech.frontmatter.slug) { - title = fiveTech.frontmatter.title - content = await fiveTech.compiledContent() -} else if (article === letsMake.frontmatter.slug) { - title = letsMake.frontmatter.title - content = await letsMake.compiledContent() -} +// Dynamically import the article based on the slug +const articleModule: any = await import(`../../content/articles/${article}.md`) +const frontmatter = articleModule.frontmatter +const content = await articleModule.compiledContent() --- - +
- - - - +