Skip to content

Commit c2f8d78

Browse files
authored
Merge pull request #238 from cnumr/cms
Cms
2 parents 0c5e956 + 746167d commit c2f8d78

19 files changed

Lines changed: 1655 additions & 820 deletions

.remarkrc.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import remarkFrontmatter from 'remark-frontmatter';
2+
import remarkLintFrontmatterSchema from 'remark-lint-frontmatter-schema';
3+
4+
const remarkConfig = {
5+
plugins: [
6+
remarkFrontmatter,
7+
[
8+
remarkLintFrontmatterSchema,
9+
{
10+
schemas: {
11+
'./content/fiche.schema.yaml': ['./src/content/fiches/**/*.{md,mdx}'],
12+
'./content/lexique.schema.yaml': [
13+
'./src/content/lexique/**/*.{md,mdx}',
14+
],
15+
'./content/personas.schema.yaml': [
16+
'./src/content/personas/**/*.{md,mdx}',
17+
],
18+
'./content/home.schema.yaml': ['./src/content/home/**/*.{md,mdx}'],
19+
'./content/default.schema.yaml': [
20+
'./src/content/mentionsLegales/**/*.{md,mdx}',
21+
],
22+
},
23+
},
24+
],
25+
],
26+
};
27+
export default remarkConfig;

components/search/input-search.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const fuseSearchOptions = {
3434
includeMatches: true,
3535
includeScore: true,
3636
useExtendedSearch: true,
37-
keys: ['title', 'contentText'],
37+
keys: ['title', 'contentText', 'refID'],
3838
};
3939

4040
export const InputSearch: FunctionComponent<InputSearchProps> = ({
@@ -107,6 +107,7 @@ export const InputSearch: FunctionComponent<InputSearchProps> = ({
107107
<Link
108108
href={item?.link}
109109
onClick={() => setSearchPattern('')}>
110+
{item?.refID !== undefined ? item?.refID + ' ' : ''}
110111
{item?.title}
111112
</Link>
112113
<p className="line-clamp-5 text-sm">{item.contentText}</p>

content/common.schema.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
allOf:
2+
- properties:
3+
title:
4+
type: string
5+
createdAt:
6+
title: createdAt
7+
description: Toto
8+
type: string
9+
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$'
10+
updatedAt:
11+
title: updatedAt
12+
description: Toto
13+
type: string
14+
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$'
15+
language:
16+
type: string
17+
pattern: '^(fr|es|en)$'
18+
published:
19+
type: boolean
20+
21+
- required:
22+
- title
23+
- createdAt
24+
- updatedAt
25+
- language
26+
- published

content/default.schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: ./common.schema.yaml

content/fiche.schema.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
allOf:
2+
- $ref: ./common.schema.yaml
3+
- properties:
4+
refID:
5+
type: string
6+
refType:
7+
type: string
8+
description: Inutile
9+
versions:
10+
type: array
11+
minItems: 1
12+
properties:
13+
version:
14+
type: string
15+
idRef:
16+
type: string
17+
people:
18+
type: string
19+
description: Inutile
20+
responsible:
21+
type: array
22+
minItems: 1
23+
properties:
24+
responsible:
25+
type: string
26+
lifecycle:
27+
type: string
28+
environmental_impact:
29+
# RWEB
30+
# type: number
31+
# RWP
32+
type: string
33+
priority_implementation:
34+
# RWEB
35+
# type: number
36+
# RWP
37+
type: string
38+
scope:
39+
type: array
40+
minItems: 1
41+
saved_resources:
42+
type: array
43+
minItems: 1
44+
validations:
45+
type: array
46+
minItems: 1
47+
properties:
48+
rule:
49+
type: string
50+
minLength: 1
51+
maxValue:
52+
type: string
53+
minLength: 1
54+
55+
- required:
56+
- refID
57+
- versions
58+
- responsible
59+
- lifecycle
60+
- environmental_impact
61+
- priority_implementation
62+
# RWEB
63+
- scope
64+
- saved_resources
65+
- validations

content/home.schema.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
allOf:
2+
- $ref: ./common.schema.yaml
3+
- properties:
4+
useProse:
5+
type: boolean
6+
7+
- required:
8+
- useProse

content/lexique.schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: ./common.schema.yaml

content/personas.schema.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
allOf:
2+
- $ref: ./common.schema.yaml
3+
- properties:
4+
shortName:
5+
type: string
6+
refType:
7+
type: string
8+
description: Inutile
9+
10+
- required:
11+
- shortName

docs/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@ Lors de la création du [Référentiel d'écoconception pour WordPress](https://
2929

3030
Après plusieurs évaluations de solutions, plusieurs versions nous avons abouti à une "stack" qui répond à nos besoins et contraintes :
3131

32-
- [TinaCMS](https://tina.io/), pour sa simplicité utilisation lors de la contribution, qu'il soit un `git-cms`, qu'il soit open-source et auto-hébergeable, et surtout qu'il utilise le format Markdown pour gérénerer ses contenus
33-
- [NextJS](https://nextjs.org/), pour sa bonne intégration à TinaCM
34-
- [Vercel](https://vercel.œom) comme hébergeur. Ce n'est pas par choix, mais c'est le seul moyen pour hébergé le CMS.
32+
[!button My Button]

0 commit comments

Comments
 (0)