diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-07-04 15:37:50 -0300 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-07-04 15:37:50 -0300 |
commit | 011c4266ccbf3ff66d92e223b2fafd291127c102 (patch) | |
tree | 8de8ed25817de784a866d8ba010ddfb7a106388c | |
parent | 2598c9ef0b945f13e94dba8f36c5fbb5cba58feb (diff) |
style: deno fmt
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
-rw-r--r-- | public/favicon.svg | 11 | ||||
-rw-r--r-- | src/components/Citations.astro | 2 | ||||
-rw-r--r-- | src/components/CopyrightNotice.astro | 68 | ||||
-rw-r--r-- | src/components/DateSelector.astro | 62 | ||||
-rw-r--r-- | src/components/Translations.astro | 16 | ||||
-rw-r--r-- | src/components/signature/Authors.astro | 30 | ||||
-rw-r--r-- | src/components/signature/Commit.astro | 4 | ||||
-rw-r--r-- | src/components/signature/Summary.astro | 2 | ||||
-rw-r--r-- | src/components/templates/SimplePostList.astro | 2 | ||||
-rw-r--r-- | src/pages/blog/read/[...slug].astro | 26 |
10 files changed, 108 insertions, 115 deletions
diff --git a/public/favicon.svg b/public/favicon.svg index 6dbe0b2..362b7a5 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,5 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> -<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="144" height="144" viewBox="0 0 144 144"> - <circle cx="72" cy="72" r="57.6" fill="#d00"/> +<svg + version="1.1" + xmlns="http://www.w3.org/2000/svg" + width="144" + height="144" + viewBox="0 0 144 144" +> + <circle cx="72" cy="72" r="57.6" fill="#d00" /> </svg> - diff --git a/src/components/Citations.astro b/src/components/Citations.astro index cc82eda..ff42ad4 100644 --- a/src/components/Citations.astro +++ b/src/components/Citations.astro @@ -7,7 +7,7 @@ const citations = await getEntries(Astro.props.citations ?? []); --- { citations.length > 0 && - ( + ( <aside> <p>O autor recomenda ler também:</p> <ul> diff --git a/src/components/CopyrightNotice.astro b/src/components/CopyrightNotice.astro index 6b3bd48..8a5ebc6 100644 --- a/src/components/CopyrightNotice.astro +++ b/src/components/CopyrightNotice.astro @@ -31,39 +31,39 @@ if (license === "WTFPL") { { /* -https://spdx.org/licenses/WTFPL.html -https://spdx.org/licenses/GFDL-1.3-or-later.html -https://spdx.org/licenses/FSFAP.html -https://artlibre.org/licence/lal/en/ -https://harmful.cat-v.org/software/ + https://spdx.org/licenses/WTFPL.html + https://spdx.org/licenses/GFDL-1.3-or-later.html + https://spdx.org/licenses/FSFAP.html + https://artlibre.org/licence/lal/en/ + https://harmful.cat-v.org/software/ -IPL-1.0 -IPA -Intel -HPND -EUPL-1.2 -EUPL-1.1 -EUDatagrid -EPL-2.0 -EPL-1.0 -EFL-2.0 -ECL-2.0 -CPL-1.0 -CPAL-1.0 -CDDL-1.0 -BSL-1.0 -BSD-3-Clause -BSD-2-Clause -Artistic-2.0 -APSL-2.0 -Apache-2.0 -Apache-1.1 -AGPL-3.0-or-later -AGPL-3.0-only -AFL-3.0 -AFL-2.1 -AFL-2.0 -AFL-1.2 -AFL-1.1 - */ + IPL-1.0 + IPA + Intel + HPND + EUPL-1.2 + EUPL-1.1 + EUDatagrid + EPL-2.0 + EPL-1.0 + EFL-2.0 + ECL-2.0 + CPL-1.0 + CPAL-1.0 + CDDL-1.0 + BSL-1.0 + BSD-3-Clause + BSD-2-Clause + Artistic-2.0 + APSL-2.0 + Apache-2.0 + Apache-1.1 + AGPL-3.0-or-later + AGPL-3.0-only + AFL-3.0 + AFL-2.1 + AFL-2.0 + AFL-1.2 + AFL-1.1 + */ } diff --git a/src/components/DateSelector.astro b/src/components/DateSelector.astro index 324bc41..d57919e 100644 --- a/src/components/DateSelector.astro +++ b/src/components/DateSelector.astro @@ -45,11 +45,9 @@ const pad = (n: number) => String(n).padStart(2, "0"); href={`/blog/${year}`} >{value}</a></span> ); - } - case "literal": { - return ( - <span>{value}</span> - ); + } + case "literal": { + return <span>{value}</span>; } } }) @@ -81,11 +79,9 @@ const pad = (n: number) => String(n).padStart(2, "0"); href={`/blog/${y}/${pad(month)}`} >{value}</a></span> ); - } - case "literal": { - return ( - <span>{value}</span> - ); + } + case "literal": { + return <span>{value}</span>; } } }) @@ -93,28 +89,28 @@ const pad = (n: number) => String(n).padStart(2, "0"); </span> { days && - ( + ( <><br /><span role="list"> Dias:{" "} { list.formatToParts(days.map((d) => { - return new Intl.DateTimeFormat("pt-PT", { day: "numeric" }) - .format( - new Date( - Date.UTC( - y, - m - 1, - d, - date.getTimezoneOffset() / 60, - date.getTimezoneOffset() % 60, - ), - ), - ); - })).map(({ type, value }: { type: string; value: string }) => { - switch (type) { - case "element": { - const day = days[dI++]; - return ( + return new Intl.DateTimeFormat("pt-PT", { day: "numeric" }) + .format( + new Date( + Date.UTC( + y, + m - 1, + d, + date.getTimezoneOffset() / 60, + date.getTimezoneOffset() % 60, + ), + ), + ); + })).map(({ type, value }: { type: string; value: string }) => { + switch (type) { + case "element": { + const day = days[dI++]; + return ( <span role="listitem"><a class:list={[{ active: day === d }]} href={`/blog/${y}/${pad(m)}/${pad(d)}`} @@ -122,12 +118,10 @@ const pad = (n: number) => String(n).padStart(2, "0"); ); } case "literal": { - return ( - <span>{value}</span> - ); - } - } - }) + return <span>{value}</span>; + } + } + }) } </span></> ) diff --git a/src/components/Translations.astro b/src/components/Translations.astro index b0164bb..6c2bf42 100644 --- a/src/components/Translations.astro +++ b/src/components/Translations.astro @@ -20,7 +20,7 @@ const translations = await getEntries(Astro.props.translations ?? []).then( --- { - /* TODO: What about <https://schema.org/translationOfWork> and <https://schema.org/translator>? */ + /* TODO: What about <https://schema.org/translationOfWork> and <https://schema.org/translator>? */ } { @@ -31,17 +31,17 @@ const translations = await getEntries(Astro.props.translations ?? []).then( <ul class="translations"> { translations.map(async ( - { data, collection, id }, - ) => { - const active = lang.localeCompare(data.lang) === 0; - return ( + { data, collection, id }, + ) => { + const active = lang.localeCompare(data.lang) === 0; + return ( <li itemprop={active ? undefined : "workTranslation"} itemscope={!active} itemtype={active ? undefined : "http://schema.org/BlogPosting"} itemid={active - ? undefined - : new URL(`${collection}/read/${id}`, Astro.site).href} + ? undefined + : new URL(`${collection}/read/${id}`, Astro.site).href} > <a href={`/${collection}/read/${id}`} @@ -56,7 +56,7 @@ const translations = await getEntries(Astro.props.translations ?? []).then( >{data.lang}</span>)</a> </li> ); - }) + }) } </ul> </nav> diff --git a/src/components/signature/Authors.astro b/src/components/signature/Authors.astro index 71a3d62..4e52d4e 100644 --- a/src/components/signature/Authors.astro +++ b/src/components/signature/Authors.astro @@ -134,18 +134,16 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { > { primary?.name - ? info?.websites[0] ? ( + ? info?.websites[0] ? ( <a itemprop="url" rel="author external noreferrer" target="_blank" href={info.websites[0]} ><span itemprop="name">{primary.name}</span></a> - ) : ( - <span itemprop="name">{primary.name}</span> - ) - : primary?.email - ? ( + ) : <span itemprop="name">{primary.name}</span> + : primary?.email + ? ( <><<a itemprop="email" rel="author external noreferrer" @@ -153,7 +151,7 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { href={primary?.email && `mailto:${primary.email}`} >{primary?.email}</a>></> ) - : "" + : "" } { primary && ( @@ -181,10 +179,8 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { <><p>Websites</p><ul> { info.websites.map(( - x, - ) => ( - <li><a href={x}>{x}</a></li> - )) + x, + ) => <li><a href={x}>{x}</a></li>) } </ul></> ) @@ -199,8 +195,8 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { <td> <><span title={fingerprint?.replace(/(....)/g, "$1 ")}>{ key - ? "0x" + toPK(key).getKeyID().toHex() - : "0x" + keyID.toHex() + ? "0x" + toPK(key).getKeyID().toHex() + : "0x" + keyID.toHex() }</span> { key && false && ( @@ -214,7 +210,7 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { } { key && - ( + ( <button popovertarget={`armor-${fingerprint}`}> Armor </button> @@ -229,9 +225,9 @@ if (!expectedFingerprints.isSubsetOf(verifiedFingerprints)) { <td> { commitSignerKey && - key?.getFingerprint().toUpperCase()?.endsWith( - commitSignerKey.toUpperCase(), - ) && "✅" + key?.getFingerprint().toUpperCase()?.endsWith( + commitSignerKey.toUpperCase(), + ) && "✅" } </td> </tr> diff --git a/src/components/signature/Commit.astro b/src/components/signature/Commit.astro index a2138ab..328a8f9 100644 --- a/src/components/signature/Commit.astro +++ b/src/components/signature/Commit.astro @@ -29,7 +29,7 @@ const formatter = new Intl.DateTimeFormat([Astro.props.lang], { ? files.map((file) => ( <dd><samp>{file.path.pathname.replace(dir.pathname, "")}</samp></dd> )) - : <dd>Nenhum ficheiro modificado</dd> + : <dd>Nenhum ficheiro modificado</dd> } <dt> Autor (<time datetime={toIso8601Full(author.date)}>{ @@ -53,7 +53,7 @@ const formatter = new Intl.DateTimeFormat([Astro.props.lang], { </dd> { signature && - ( + ( <dt>Assinatura do commit</dt> <dd> <dl> diff --git a/src/components/signature/Summary.astro b/src/components/signature/Summary.astro index 6ab6bf5..f25c1d1 100644 --- a/src/components/signature/Summary.astro +++ b/src/components/signature/Summary.astro @@ -161,7 +161,7 @@ A assinatura digital é criptograficamente válida. <strong>O dono da chave púb { lvl && - ( + ( <details class:list={{ ok: lvl[0] === Level.OK, diff --git a/src/components/templates/SimplePostList.astro b/src/components/templates/SimplePostList.astro index 0ec33e3..c2c002b 100644 --- a/src/components/templates/SimplePostList.astro +++ b/src/components/templates/SimplePostList.astro @@ -25,7 +25,7 @@ const { posts } = Astro.props; <h3><a href={`/blog/read/${id}`}>{title}</a></h3> { description && - description.split("\n\n").map((paragraph) => ( + description.split("\n\n").map((paragraph) => ( <p class="small">{paragraph}</p> )) } diff --git a/src/pages/blog/read/[...slug].astro b/src/pages/blog/read/[...slug].astro index 348a976..5b42e86 100644 --- a/src/pages/blog/read/[...slug].astro +++ b/src/pages/blog/read/[...slug].astro @@ -133,8 +133,8 @@ const commit = await verification?.commit; <BaseHead title={post.data.title} description={"description" in post.data - ? post.data.description - : post.data.title} + ? post.data.description + : post.data.title} /> </head> @@ -158,16 +158,14 @@ const commit = await verification?.commit; </hgroup> { "description" in post.data && post.data.description && - ( + ( <section itemprop="abstract"> <h2>Resumo</h2> { post.data.description.split(new RegExp("\\s{2,}")) - .map(( - x, - ) => ( - <p>{x}</p> - )) + .map(( + x, + ) => <p>{x}</p>) } </section> ) @@ -176,7 +174,7 @@ const commit = await verification?.commit; <footer> { verification?.verifications && - ( + ( <Authors verifications={verification.verifications} expectedSigners={signers} @@ -192,8 +190,8 @@ const commit = await verification?.commit; datetime={toIso8601Full(post.data.dateCreated)} >{ new Intl.DateTimeFormat([lang], {}).format( - post.data.dateCreated, - ) + post.data.dateCreated, + ) }</time> </dd> { @@ -204,15 +202,15 @@ const commit = await verification?.commit; datetime={toIso8601Full(post.data.dateUpdated)} >{ new Intl.DateTimeFormat([lang], {}).format( - post.data.dateUpdated, - ) + post.data.dateUpdated, + ) }</time> </dd> ) } { "locationCreated" in post.data && - post.data.locationCreated && ( + post.data.locationCreated && ( <dt itemprop="locationCreated" itemscope |