diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-08-05 18:50:37 +0100 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-08-05 18:50:37 +0100 |
commit | 0af094770c4ebabc56ff761a8bd215bc397c0f7e (patch) | |
tree | a9ad669c8b84b4d13897732ed93ccfcbbeb2cb25 /src/components/templates/licenses/WTFPL.astro | |
parent | 84eef3f848c4efa18985a776021a58720744523a (diff) |
refactor: reading page review
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/components/templates/licenses/WTFPL.astro')
-rw-r--r-- | src/components/templates/licenses/WTFPL.astro | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/components/templates/licenses/WTFPL.astro b/src/components/templates/licenses/WTFPL.astro new file mode 100644 index 0000000..d3546c7 --- /dev/null +++ b/src/components/templates/licenses/WTFPL.astro @@ -0,0 +1,70 @@ +--- +import { listYearsWithRanges } from "@utils/datetime"; +import type { Props as BaseProps } from "../CopyrightNotice.astro"; +interface Props extends BaseProps {} + +const { years, holders } = Astro.props; +const firstYear = Math.min(...years); +const lastYears = years.sort((a, b) => a - b).slice(1); +--- + +<footer itemprop="copyrightNotice"> + <p> + <small> + Copyright © <span itemprop="copyrightYear">{firstYear}</span>, { + listYearsWithRanges(lastYears, { + list: { type: "unit", style: "narrow" }, + locale: "en", + }).replace(/^\d+/, "") + } + + { + holders.map(({ name, url, email }) => { + if (name === undefined) return undefined; + + const website = url?.[0]; + + return ( + <span + itemprop="copyrightHolder" + itemscope + itemtype="https://schema.org/Person" + >{ + website !== undefined ? ( + <a + itemprop="url" + rel="author external noreferrer" + target="_blank" + href={website} + content={website} + ><span itemprop="name">{name}</span></a> + ) : <span itemprop="name">{name}</span> + } + { + email !== undefined && ( + <><<a + itemprop="email" + rel="author external noreferrer" + target="_blank" + href={`mailto:${email}`} + >{email}</a>></> + ) + }</span> + ); + }) + } + </small> + </p> + <p> + <small> + This work is free. You can redistribute it and/or modify it under the + terms of the Do What The Fuck You Want To Public License, Version 2, as + published by Sam Hocevar. See <a + itemprop="license" + href="http://www.wtfpl.net/" + rel="license noreferrer" + target="_blank" + >http://www.wtfpl.net/</a> for more details. + </small> + </p> +</footer> |