From 968a171408e2f8645867d53c3128a86ed15fa18c Mon Sep 17 00:00:00 2001 From: tree Date: Mon, 12 Feb 2024 12:10:02 +0100 Subject: [PATCH] update --- data/2024/week07.md | 3 +++ web/src/components/WeekNews.astro | 4 ++-- web/src/layouts/base.astro | 7 +++++-- web/src/pages/index.astro | 3 --- web/src/pages/issue/[week].astro | 24 ++++++++++++++++++++++++ 5 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 data/2024/week07.md create mode 100644 web/src/pages/issue/[week].astro diff --git a/data/2024/week07.md b/data/2024/week07.md new file mode 100644 index 0000000..8c95ac3 --- /dev/null +++ b/data/2024/week07.md @@ -0,0 +1,3 @@ +--- +curator: Mykola +--- \ No newline at end of file diff --git a/web/src/components/WeekNews.astro b/web/src/components/WeekNews.astro index ddc70bb..34ce358 100644 --- a/web/src/components/WeekNews.astro +++ b/web/src/components/WeekNews.astro @@ -12,10 +12,10 @@ const current = false;
-

Week {issue.week.split('-').join('/')}

+

Week {issue.week.split('-').join('/')}

{format(issue.period[0], "MMM d")} - {format(issue.period[1], "MMM d, yyyy")}
{!issue.published && -
🚧 Current week
+
🚧 Future edition
}
diff --git a/web/src/layouts/base.astro b/web/src/layouts/base.astro index ac73a39..0e202a4 100644 --- a/web/src/layouts/base.astro +++ b/web/src/layouts/base.astro @@ -19,13 +19,16 @@ import '../styles/base.css';
- Documentation - Source code + Subscribe now!
+
+ Documentation + Source code +
\ No newline at end of file diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 581dcc6..7058f09 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -7,9 +7,6 @@ import issues from '../issues.json'; --- - {issues.map((issue) => ( ))} diff --git a/web/src/pages/issue/[week].astro b/web/src/pages/issue/[week].astro new file mode 100644 index 0000000..ced8cac --- /dev/null +++ b/web/src/pages/issue/[week].astro @@ -0,0 +1,24 @@ +--- +import BaseLayout from '../../layouts/base.astro'; +import WeekNews from '../../components/WeekNews.astro'; +import issues from '../../issues.json'; + +export function getStaticPaths() { + return issues.map(issue => { + return { + params: { week: issue.week } + } + }) +} + +const { week } = Astro.params; +const issue = issues.find(item => item.week === week); + +--- + + + + + \ No newline at end of file