From 444bf00462bcd9243e785a330d47dbc727586fbb Mon Sep 17 00:00:00 2001 From: rvcas Date: Thu, 28 Mar 2024 23:49:28 -0400 Subject: [PATCH 1/2] fix: use curlies for JS expressions --- src/pages/projects/amaru.astro | 233 ++++++++++++++++++++------------- 1 file changed, 142 insertions(+), 91 deletions(-) diff --git a/src/pages/projects/amaru.astro b/src/pages/projects/amaru.astro index 633f953..4cb306f 100644 --- a/src/pages/projects/amaru.astro +++ b/src/pages/projects/amaru.astro @@ -3,7 +3,7 @@ import { getEntry } from 'astro:content'; import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkRehype from 'remark-rehype'; -import rehypeStringify from 'rehype-stringify' +import rehypeStringify from 'rehype-stringify'; import Layout from '../../layouts/base.astro'; @@ -14,109 +14,162 @@ import Section from '../../components/Section.astro'; const project = await getEntry('projects', 'amaru'); -const maintainers = await Promise.all(project.data.maintainers.map(async id => { - const { data } = await getEntry('maintainers', id.toLowerCase()); - return data; -})); +const maintainers = await Promise.all( + project.data.maintainers.map(async (id: string) => { + const { data } = await getEntry('maintainers', id.toLowerCase()); + return data; + }), +); const { Content } = await project.render(); -const render = md => unified() - .use(remarkParse) - .use(remarkRehype) - .use(rehypeStringify) - .processSync(md); +const render = (md) => + unified() + .use(remarkParse) + .use(remarkRehype) + .use(rehypeStringify) + .processSync(md); --- - +
-
- - - +
+ + +
- { - maintainers.map( - (m) => ( + { + maintainers.map((m) => (
- `${m.id}'s -

{m.firstname} {m.lastname}

- {m.role} @ {m.company} + {`${m.id}'s +

+ {m.firstname} {m.lastname} +

+ + {m.role} @ {m.company} +
- ) - ) - } + )) + }
+ tag="Journey" + id="journey" + title="An incremental roadmap in 4-phases">
<> { - project.data.roadmap.phases.flatMap( - (phase, ix) => { - const milestones = phase.milestones.flatMap((milestone, jx) => ( - - - )); - const checked = ix === 0; - return ( - - + project.data.roadmap.phases.flatMap((phase, ix) => { + const milestones = phase.milestones.flatMap((milestone, jx) => ( + <> + + + + )); + const checked = ix === 0; + return ( + <> + + <>{milestones} - ); - } - ) + + ); + }) }
{ - project.data.roadmap.phases.map( - (phase, ix) => ( -
-

{phase.name}

- <>{ render(phase.description) } -
-
-
    - { - phase.packages.map( - (pkg, jx) => { - const checked = jx === 0; - return ( -
  • - - - -
  • - ); - } - ) - } -
-
-
- ) - ) + project.data.roadmap.phases.map((phase, ix) => ( + + )) }
@@ -204,14 +257,13 @@ const render = md => unified() } } - - input[type=radio].phase, - input[type=radio].milestone, - input[type=radio].package { + input[type='radio'].phase, + input[type='radio'].milestone, + input[type='radio'].package { display: none; } - input[type=radio] + label { + input[type='radio'] + label { cursor: pointer; } @@ -270,21 +322,20 @@ const render = md => unified() } } - input[type=radio]:checked + label { + input[type='radio']:checked + label { &::after { background-color: var(--color); } } - input#phase-1:checked ~ main article[data-phase=1], - input#phase-2:checked ~ main article[data-phase=2], - input#phase-3:checked ~ main article[data-phase=3], - input#phase-4:checked ~ main article[data-phase=4] { + input#phase-1:checked ~ main article[data-phase='1'], + input#phase-2:checked ~ main article[data-phase='2'], + input#phase-3:checked ~ main article[data-phase='3'], + input#phase-4:checked ~ main article[data-phase='4'] { display: flex; flex-direction: column; } - #journey { & .wrapper { position: relative; @@ -311,7 +362,7 @@ const render = md => unified() margin: var(--gap-md) 0; } - & h3 , + & h3, & h4 { color: var(--color); margin-bottom: var(--gap-md); From 9533c2b9ccbf754d406a6fea033a0852388cf3d2 Mon Sep 17 00:00:00 2001 From: rvcas Date: Thu, 28 Mar 2024 23:54:20 -0400 Subject: [PATCH 2/2] chore: run fmt --- src/components/Pattern.astro | 12 ++++++++++-- src/content/projects/amaru.md | 2 +- src/layouts/base.astro | 5 ++++- src/pages/projects.astro | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/Pattern.astro b/src/components/Pattern.astro index 7a90d13..05dd94c 100644 --- a/src/components/Pattern.astro +++ b/src/components/Pattern.astro @@ -43,8 +43,16 @@ const patternId = createHash('sha256') return ( <> - - + + ); }), diff --git a/src/content/projects/amaru.md b/src/content/projects/amaru.md index 9d19ed9..8fd4bb4 100644 --- a/src/content/projects/amaru.md +++ b/src/content/projects/amaru.md @@ -1,7 +1,7 @@ --- name: Amaru -shortDescription: | +shortDescription: | An alternative Rust node client for the Cardano blockchain. summary: | diff --git a/src/layouts/base.astro b/src/layouts/base.astro index 8a29f5b..6d80c61 100644 --- a/src/layouts/base.astro +++ b/src/layouts/base.astro @@ -196,7 +196,9 @@ const title = Astro.props.title ? `PRAGMA – ${Astro.props.title}` : `PRAGMA`; - + @@ -248,4 +250,5 @@ const title = Astro.props.title ? `PRAGMA – ${Astro.props.title}` : `PRAGMA`;