From 2b5397e8f2aa8928721f340309679cac5646238c Mon Sep 17 00:00:00 2001 From: 0xdevant <0xdevant@gmail.com> Date: Sun, 22 Sep 2024 18:50:04 +0800 Subject: [PATCH] feat: add empty checking to filter out empty weekly news md file --- data/2024/week10.md | 27 ++++++++++++++------------- data/2024/week13.md | 3 +-- data/2024/week15.md | 3 +-- data/2024/week16.md | 1 + data/2024/week17.md | 1 + data/2024/week20.md | 26 ++++++++++++++------------ data/2024/week21.md | 26 ++++++++++++++------------ data/2024/week22.md | 26 ++++++++++++++------------ data/2024/week23.md | 26 ++++++++++++++------------ data/2024/week24.md | 26 ++++++++++++++------------ web/src/components/WeekNews.astro | 4 ++-- web/src/pages/index.astro | 20 +++++++++++--------- 12 files changed, 101 insertions(+), 88 deletions(-) diff --git a/data/2024/week10.md b/data/2024/week10.md index eb17453..b5ab390 100644 --- a/data/2024/week10.md +++ b/data/2024/week10.md @@ -1,5 +1,6 @@ --- curator: Coinmandeer +skip: true --- - --- ### Upcoming events -*(new/changes in **bold**)* -* Apr 10, [zkSummit](https://www.zksummit.com/) (Athens) conference -* Apr 12-14, [ETHDam](https://www.ethdam.com/) hackathon -* **Apr 24, [Privacy Reunion 2](https://twitter.com/privacyguardia/status/1762532962875121786) (Barcelona) conference** -* May 24-26, [ETHBerlin](https://ethberlin.org/) hackathon -* May 30, [Web3Privacy Now Summit](https://web3privacy.info/events/) (Prague) conference -* Jun 7-9, [MoneroKon](https://monerokon.org/) (Prague) conference & hackathon -* Jun 19-26, [Web3Privacy Now Hackathon](https://web3privacy.info/events/) (Bled) -* Oct 4-6, [Hackers Congress Paralelní Polis (HCPP)](https://hcpp.cz/) (Prague) conference -* Oct 4-6, [ETHRome](https://ethrome.org/) hackathon -* Oct, [Web3Privacy Now Summit](https://web3privacy.info/events/) (Brno) conference -* Oct, [ETHBrno](https://ethbrno.cz/) hackathon +_(new/changes in **bold**)_ + +- Apr 10, [zkSummit](https://www.zksummit.com/) (Athens) conference +- Apr 12-14, [ETHDam](https://www.ethdam.com/) hackathon +- **Apr 24, [Privacy Reunion 2](https://twitter.com/privacyguardia/status/1762532962875121786) (Barcelona) conference** +- May 24-26, [ETHBerlin](https://ethberlin.org/) hackathon +- May 30, [Web3Privacy Now Summit](https://web3privacy.info/events/) (Prague) conference +- Jun 7-9, [MoneroKon](https://monerokon.org/) (Prague) conference & hackathon +- Jun 19-26, [Web3Privacy Now Hackathon](https://web3privacy.info/events/) (Bled) +- Oct 4-6, [Hackers Congress Paralelní Polis (HCPP)](https://hcpp.cz/) (Prague) conference +- Oct 4-6, [ETHRome](https://ethrome.org/) hackathon +- Oct, [Web3Privacy Now Summit](https://web3privacy.info/events/) (Brno) conference +- Oct, [ETHBrno](https://ethbrno.cz/) hackathon diff --git a/data/2024/week13.md b/data/2024/week13.md index 60fcae8..f38f3f6 100644 --- a/data/2024/week13.md +++ b/data/2024/week13.md @@ -1,5 +1,6 @@ --- curator: mykola +skip: true --- - - diff --git a/data/2024/week15.md b/data/2024/week15.md index 60fcae8..f38f3f6 100644 --- a/data/2024/week15.md +++ b/data/2024/week15.md @@ -1,5 +1,6 @@ --- curator: mykola +skip: true --- - - diff --git a/data/2024/week16.md b/data/2024/week16.md index f75cfb3..f38f3f6 100644 --- a/data/2024/week16.md +++ b/data/2024/week16.md @@ -1,5 +1,6 @@ --- curator: mykola +skip: true ---

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

diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index e439195..1b1d82f 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -1,13 +1,15 @@ --- - -import BaseLayout from '../layouts/base.astro'; -import WeekNews from '../components/WeekNews.astro'; -import issues from '../issues.json'; - +import BaseLayout from "../layouts/base.astro"; +import WeekNews from "../components/WeekNews.astro"; +import issues from "../issues.json"; --- - {issues.sort((x, y) => x.period[0] < y.period[0] ? 1 : -1).filter(i => i.newsHtml !== "").map((issue) => ( - - ))} - \ No newline at end of file + { + issues + .sort((x, y) => (x.period[0] < y.period[0] ? 1 : -1)) + // use skip flag to filter out any editions that should be skipped instead of relying on regex match on empty content + .filter((i) => i.newsHtml !== "" && !i.skip) + .map((issue) => ) + } +