From afe4aadc2609f03d9fcf25f124c4e9dd847f153b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Martin?= Date: Fri, 7 Mar 2025 12:41:39 -0500 Subject: [PATCH] =?UTF-8?q?Customization=20du=20template=20des=20pour=20pr?= =?UTF-8?q?=C3=A9parer=20le=20terrain=20pour=20les=20licences=20et=20Ajout?= =?UTF-8?q?=20du=20copyleft=20et=20unlicenced.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro.config.mjs | 7 +- package.json | 2 +- src/components/CtaContentPanel.astro | 30 +++++++++ src/components/FooterWithCta.astro | 67 +++++++++++++++++++ src/components/TwoColumnContent.astro | 22 ++++++ src/content.config.ts | 13 +++- src/content/components/CTA.astro | 12 ++++ .../docs/fr/guides/licences/copyleft.mdx | 8 +++ .../docs/fr/guides/licences/unlicenced.mdx | 14 ++++ src/sidebars/fr/sidebar.ts | 6 ++ 10 files changed, 176 insertions(+), 5 deletions(-) create mode 100644 src/components/CtaContentPanel.astro create mode 100644 src/components/FooterWithCta.astro create mode 100644 src/components/TwoColumnContent.astro create mode 100644 src/content/components/CTA.astro create mode 100644 src/content/docs/fr/guides/licences/copyleft.mdx create mode 100644 src/content/docs/fr/guides/licences/unlicenced.mdx diff --git a/astro.config.mjs b/astro.config.mjs index 01149ba..add3d39 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -36,7 +36,12 @@ export default defineConfig({ social: { // todo: implement gitea social github: 'https://git.quebec', }, - sidebar: sidebarFr + sidebar: sidebarFr, + components: { + TwoColumnContent: './src/components/TwoColumnContent.astro', + ContentPanel: './src/components/CtaContentPanel.astro', + Footer: './src/components/FooterWithCta.astro', + }, }), ], redirects: { diff --git a/package.json b/package.json index c89c2b5..e45b905 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "", + "name": "opensource.quebec", "type": "module", "version": "0.0.1", "scripts": { diff --git a/src/components/CtaContentPanel.astro b/src/components/CtaContentPanel.astro new file mode 100644 index 0000000..875c391 --- /dev/null +++ b/src/components/CtaContentPanel.astro @@ -0,0 +1,30 @@ +--- +import Default from '@astrojs/starlight/components/ContentPanel.astro'; + +const { entry, ...props } = Astro.props; +--- +
+
+
+ + \ No newline at end of file diff --git a/src/components/FooterWithCta.astro b/src/components/FooterWithCta.astro new file mode 100644 index 0000000..0733af5 --- /dev/null +++ b/src/components/FooterWithCta.astro @@ -0,0 +1,67 @@ +--- +import type { Props } from '@astrojs/starlight/props'; + +import EditLink from 'virtual:starlight/components/EditLink'; +import LastUpdated from 'virtual:starlight/components/LastUpdated'; +import Pagination from 'virtual:starlight/components/Pagination'; +import config from 'virtual:starlight/user-config'; +import {Icon} from '@astrojs/starlight/components'; +import CTA from "../content/components/CTA.astro"; + +const { entry, ...props } = Astro.props; +--- + + + + diff --git a/src/components/TwoColumnContent.astro b/src/components/TwoColumnContent.astro new file mode 100644 index 0000000..81d705a --- /dev/null +++ b/src/components/TwoColumnContent.astro @@ -0,0 +1,22 @@ +--- +import Default from '@astrojs/starlight/components/TwoColumnContent.astro'; + +const { entry, ...props } = Astro.props; + +const isProd = import.meta.env.PROD; +const isDev = import.meta.env.DEV; +--- + + + + + + {isDev && +
+ Débug +
{Object.keys(Astro.props).toString()}
+
{Object.keys(entry).toString()}
+
{Object.keys(entry.data).toString()}
+
+ } +
\ No newline at end of file diff --git a/src/content.config.ts b/src/content.config.ts index d9ee8c9..6bf2f6e 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -1,7 +1,14 @@ -import { defineCollection } from 'astro:content'; +import { z, defineCollection } from 'astro:content'; import { docsLoader } from '@astrojs/starlight/loaders'; import { docsSchema } from '@astrojs/starlight/schema'; export const collections = { - docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), -}; + docs: defineCollection({ + loader: docsLoader(), + schema: docsSchema({ + extend: z.object({ + cta: z.string().optional(), + }) + }) + }), +}; \ No newline at end of file diff --git a/src/content/components/CTA.astro b/src/content/components/CTA.astro new file mode 100644 index 0000000..2fea63f --- /dev/null +++ b/src/content/components/CTA.astro @@ -0,0 +1,12 @@ +--- +import {Icon} from '@astrojs/starlight/components'; +import type { Icons } from '@astrojs/starlight/components/Icons'; + +interface Props { + icon?: keyof typeof Icons; + title?: string; +} +const { icon, title } = Astro.props; +--- + +{title ?? "title"}{icon && } \ No newline at end of file diff --git a/src/content/docs/fr/guides/licences/copyleft.mdx b/src/content/docs/fr/guides/licences/copyleft.mdx new file mode 100644 index 0000000..2f54e1b --- /dev/null +++ b/src/content/docs/fr/guides/licences/copyleft.mdx @@ -0,0 +1,8 @@ +--- +title: Copyleft +description: Copyleft +author: L'équipe OSQ +lastUpdated: 2025-03-05 +draft: false +cta: https://www.gnu.org/philosophy/free-sw.html +--- \ No newline at end of file diff --git a/src/content/docs/fr/guides/licences/unlicenced.mdx b/src/content/docs/fr/guides/licences/unlicenced.mdx new file mode 100644 index 0000000..46b4cf9 --- /dev/null +++ b/src/content/docs/fr/guides/licences/unlicenced.mdx @@ -0,0 +1,14 @@ +--- +title: Unlicense +description: Permet de publier votre code dans le domaine public plus facilement grâce au travail qui a été fait pour SQLite +author: L'équipe OSQ +lastUpdated: 2025-03-05 +draft: false +cta: https://unlicense.org/ +--- + +## La grosse différence avec le copyleft + +C'est qu'il y a eu un travail légal fait pour libérer les droits des contributeurs et la même protection de sans garantie comme la licence MIT. + +https://ar.to/2010/01/dissecting-the-unlicense \ No newline at end of file diff --git a/src/sidebars/fr/sidebar.ts b/src/sidebars/fr/sidebar.ts index 54f628f..6492e53 100644 --- a/src/sidebars/fr/sidebar.ts +++ b/src/sidebars/fr/sidebar.ts @@ -36,6 +36,12 @@ }, { slug: 'guides/licences/mit' + }, + { + slug: 'guides/licences/unlicenced' + }, + { + slug: 'guides/licences/copyleft' } ] },