summaryrefslogtreecommitdiff
path: root/src/components/signature/Downloads.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/signature/Downloads.astro')
-rw-r--r--src/components/signature/Downloads.astro63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/components/signature/Downloads.astro b/src/components/signature/Downloads.astro
deleted file mode 100644
index 3497b37..0000000
--- a/src/components/signature/Downloads.astro
+++ /dev/null
@@ -1,63 +0,0 @@
----
-import { gitDir } from "@lib/git";
-import { get } from "@utils/anonymous";
-
-interface Props {
- lang: string;
-}
-
-const { lang } = Astro.props;
-
-let source = new URL(
- `${Astro.url.href.replace(/\/$/, "")}.md`,
-);
-
-const dir = await gitDir();
-
-const format: Intl.NumberFormatOptions = {
- notation: "compact",
- style: "unit",
- unit: "byte",
- unitDisplay: "narrow",
-};
-
-const formatter = new Intl.NumberFormat(lang, format);
-
-const sourceSize = formatter.format(
- await Deno.stat(
- new URL("public" + source.pathname, dir),
- ).then(get("size")),
-);
-const sig = await Deno.stat(
- new URL("public" + source.pathname + ".sig", dir),
-).then(get("size")).catch(() => undefined);
-const sigSize = formatter.format(sig);
----
-
-<section>
- <p>Ficheiros para descarregar:</p>
- <dl>
- <dt>Blog post</dt>
- <dd>
- <a
- id="message"
- href={source}
- download
- type="text/markdown; charset=utf-8"
- ><samp>text/markdown</samp>, <samp>{sourceSize}</samp></a>
- </dd>
- {
- sig && (
- <dt>Assinatura digital</dt>
- <dd>
- <a
- id="signature"
- href={`${source}.sig`}
- download
- type="application/pgp-signature"
- ><samp>application/pgp-signature</samp>, <samp>{sigSize}</samp></a>
- </dd>
- )
- }
- </dl>
-</section>