From 0af094770c4ebabc56ff761a8bd215bc397c0f7e Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Tue, 5 Aug 2025 18:50:37 +0100 Subject: refactor: reading page review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/components/templates/licenses/CC.astro | 153 +++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 src/components/templates/licenses/CC.astro (limited to 'src/components/templates/licenses/CC.astro') diff --git a/src/components/templates/licenses/CC.astro b/src/components/templates/licenses/CC.astro new file mode 100644 index 0000000..2aea423 --- /dev/null +++ b/src/components/templates/licenses/CC.astro @@ -0,0 +1,153 @@ +--- +import type { ComponentProps } from "astro/types"; +import type CopyrightNotice from "@components/templates/CopyrightNotice.astro"; +import { listYearsWithRanges } from "@utils/datetime"; +interface Props extends ComponentProps {} + +let { license, title, holders, years } = Astro.props; + +if (typeof license !== "string") throw new Error(); + +const publicdomain = license === "CC0"; +const sa = /SA/.test(license); +const nd = /ND/.test(license); +const nc = /NC/.test(license); +const licenseURL = `https://creativecommons.org/licenses/${ + license.slice(3).toLowerCase() +}/4.0/`; + +const firstYear = Math.min(...years); +const lastYears = years.sort((a, b) => a - b).slice(1); +--- + + -- cgit v1.2.3