Customization du template des pour préparer le terrain pour les licences et Ajout du copyleft et unlicenced.
This commit is contained in:
parent
e79a470fed
commit
afe4aadc26
@ -36,7 +36,12 @@ export default defineConfig({
|
|||||||
social: { // todo: implement gitea social
|
social: { // todo: implement gitea social
|
||||||
github: 'https://git.quebec',
|
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: {
|
redirects: {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "",
|
"name": "opensource.quebec",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
30
src/components/CtaContentPanel.astro
Normal file
30
src/components/CtaContentPanel.astro
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
import Default from '@astrojs/starlight/components/ContentPanel.astro';
|
||||||
|
|
||||||
|
const { entry, ...props } = Astro.props;
|
||||||
|
---
|
||||||
|
<div class="content-panel">
|
||||||
|
<div class="sl-container"><slot /></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.content-panel {
|
||||||
|
padding: 1.5rem var(--sl-content-pad-x);
|
||||||
|
}
|
||||||
|
.content-panel + .content-panel {
|
||||||
|
border-top: 1px solid var(--sl-color-hairline);
|
||||||
|
}
|
||||||
|
.sl-container {
|
||||||
|
max-width: var(--sl-content-width);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sl-container > :global(* + *) {
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 72rem) {
|
||||||
|
.sl-container {
|
||||||
|
margin-inline: var(--sl-content-margin-inline, auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
67
src/components/FooterWithCta.astro
Normal file
67
src/components/FooterWithCta.astro
Normal file
@ -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;
|
||||||
|
---
|
||||||
|
|
||||||
|
<footer class="sl-flex">
|
||||||
|
<div class="meta sl-flex">
|
||||||
|
{entry.data.cta &&
|
||||||
|
<div>{entry.data.cta}</div>
|
||||||
|
<CTA title="CTA du footer" />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="meta sl-flex">
|
||||||
|
<EditLink {...Astro.props} />
|
||||||
|
<LastUpdated {...Astro.props} />
|
||||||
|
</div>
|
||||||
|
<Pagination {...Astro.props} />
|
||||||
|
|
||||||
|
{
|
||||||
|
config.credits && (
|
||||||
|
<a class="kudos sl-flex" href="https://starlight.astro.build">
|
||||||
|
<Icon name={'starlight'} /> {Astro.locals.t('builtWithStarlight.label')}
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
footer {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
.meta {
|
||||||
|
gap: 0.75rem 3rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 3rem;
|
||||||
|
font-size: var(--sl-text-sm);
|
||||||
|
color: var(--sl-color-gray-3);
|
||||||
|
}
|
||||||
|
.meta > :global(p:only-child) {
|
||||||
|
margin-inline-start: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kudos {
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5em;
|
||||||
|
margin: 1.5rem auto;
|
||||||
|
font-size: var(--sl-text-xs);
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--sl-color-gray-3);
|
||||||
|
}
|
||||||
|
.kudos :global(svg) {
|
||||||
|
color: var(--sl-color-orange);
|
||||||
|
}
|
||||||
|
.kudos:hover {
|
||||||
|
color: var(--sl-color-white);
|
||||||
|
}
|
||||||
|
</style>
|
22
src/components/TwoColumnContent.astro
Normal file
22
src/components/TwoColumnContent.astro
Normal file
@ -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;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Default>
|
||||||
|
<slot />
|
||||||
|
<slot name="right-sidebar" slot="right-sidebar" />
|
||||||
|
|
||||||
|
{isDev &&
|
||||||
|
<div>
|
||||||
|
<strong>Débug</strong>
|
||||||
|
<label>Props</label> <pre>{Object.keys(Astro.props).toString()}</pre>
|
||||||
|
<label>Entry</label> <pre>{Object.keys(entry).toString()}</pre>
|
||||||
|
<label>Data</label> <pre>{Object.keys(entry.data).toString()}</pre>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</Default>
|
@ -1,7 +1,14 @@
|
|||||||
import { defineCollection } from 'astro:content';
|
import { z, defineCollection } from 'astro:content';
|
||||||
import { docsLoader } from '@astrojs/starlight/loaders';
|
import { docsLoader } from '@astrojs/starlight/loaders';
|
||||||
import { docsSchema } from '@astrojs/starlight/schema';
|
import { docsSchema } from '@astrojs/starlight/schema';
|
||||||
|
|
||||||
export const collections = {
|
export const collections = {
|
||||||
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
docs: defineCollection({
|
||||||
|
loader: docsLoader(),
|
||||||
|
schema: docsSchema({
|
||||||
|
extend: z.object({
|
||||||
|
cta: z.string().optional(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}),
|
||||||
};
|
};
|
12
src/content/components/CTA.astro
Normal file
12
src/content/components/CTA.astro
Normal file
@ -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 && <Icon name={icon} class="icon" size="1.333em" />}
|
8
src/content/docs/fr/guides/licences/copyleft.mdx
Normal file
8
src/content/docs/fr/guides/licences/copyleft.mdx
Normal file
@ -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
|
||||||
|
---
|
14
src/content/docs/fr/guides/licences/unlicenced.mdx
Normal file
14
src/content/docs/fr/guides/licences/unlicenced.mdx
Normal file
@ -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
|
@ -36,6 +36,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
slug: 'guides/licences/mit'
|
slug: 'guides/licences/mit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slug: 'guides/licences/unlicenced'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slug: 'guides/licences/copyleft'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user