Skip to content

Commit b563035

Browse files
committed
🏗️(frontend) Footer configurable
To have different footer per instance the content of the footer is now configurable from the theme customization file. See THEME_CUSTOMIZATION_FILE_PATH env var.
1 parent 3101548 commit b563035

File tree

12 files changed

+447
-257
lines changed

12 files changed

+447
-257
lines changed

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@ and this project adheres to
1313
- ✨(back) add endpoint checking media status
1414
- ✨(backend) allow setting session cookie age via env var #977
1515
- ✨(backend) allow theme customnization using a configuration file #948
16-
- ✨ Add a custom callout block to the editor #892
16+
-(frontend) Add a custom callout block to the editor #892
1717
- 🚩(frontend) version MIT only #911
1818
- ✨(backend) integrate maleware_detection from django-lasuite #936
19+
- 🏗️(frontend) Footer configurable #959
1920
- 🩺(CI) add lint spell mistakes #954
2021
- 🛂(frontend) block edition to not connected users #945
2122
- 🚸 Let loader during upload analyze #984
2223

2324
### Changed
2425

25-
- 📝(frontend) Update documentation
26-
- ✅(frontend) Improve tests coverage
26+
- 📝(frontend) Update documentation #949
27+
- ✅(frontend) Improve tests coverage #949
2728
- ⬆️(docker) upgrade backend image to python 3.13 #973
2829
- ⬆️(docker) upgrade node images to alpine 3.21
2930
- 🐛(y-provider) increase JSON size limits for transcription conversion
3031

3132

3233
### Removed
3334

34-
- 🔥(back) remove footer endpoint
35+
- 🔥(back) remove footer endpoint #948
3536

3637
## [3.2.1] - 2025-05-06
3738

docs/assets/footer-configurable.png

19.4 KB
Loading

docs/theming.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,27 @@ body {
3030

3131
Then, set the `FRONTEND_CSS_URL` environment variable to the URL of your custom CSS file. Once you've done this, our application will load your custom CSS file and apply the styles, changing the background color to the custom color you specified.
3232

33+
----
34+
35+
# **Footer Configuration** 📝
36+
37+
The footer is configurable from the theme customization file.
38+
39+
### Settings 🔧
40+
41+
```shellscript
42+
THEME_CUSTOMIZATION_FILE_PATH=<path>
43+
```
44+
45+
### Example of JSON
46+
47+
The json must follow some rules: https://github.com/suitenumerique/docs/blob/main/src/helm/env.d/dev/configuration/theme/demo.json
48+
49+
`footer.default` is the fallback if the language is not supported.
50+
51+
---
52+
Below is a visual example of a configured footer ⬇️:
53+
54+
![Footer Configuration Example](./assets/footer-configurable.png)
55+
3356

Lines changed: 120 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,129 @@
11
{
2-
"footer": {
3-
"default": {
4-
"externalLinks": [
5-
{
6-
"label": "Github",
7-
"href": "https://github.com/suitenumerique/docs/"
8-
},
9-
{
10-
"label": "DINUM",
11-
"href": "https://www.numerique.gouv.fr/dinum/"
12-
},
13-
{
14-
"label": "ZenDiS",
15-
"href": "https://zendis.de/"
16-
},
17-
{
18-
"label": "BlockNote.js",
19-
"href": "https://www.blocknotejs.org/"
20-
}
21-
],
22-
"bottomInformation": {
23-
"label": "Unless otherwise stated, all content on this site is under",
24-
"link": {
25-
"label": "licence etalab-2.0",
26-
"href": "https://github.com/etalab/licence-ouverte/blob/master/LO.md"
27-
}
28-
}
2+
"footer": {
3+
"default": {
4+
"logo": {
5+
"src": "/assets/icon-docs.svg",
6+
"width": "54px",
7+
"alt": "Docs Logo",
8+
"withTitle": true
299
},
30-
"en": {
31-
"legalLinks": [
32-
{
33-
"label": "Legal Notice",
34-
"href": "#"
35-
},
36-
{
37-
"label": "Personal data and cookies",
38-
"href": "#"
39-
},
40-
{
41-
"label": "Accessibility",
42-
"href": "#"
43-
}
44-
],
45-
"bottomInformation": {
46-
"label": "Unless otherwise stated, all content on this site is under",
47-
"link": {
48-
"label": "licence MIT",
49-
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
50-
}
10+
"externalLinks": [
11+
{
12+
"label": "Github",
13+
"href": "https://github.com/suitenumerique/docs/"
14+
},
15+
{
16+
"label": "DINUM",
17+
"href": "https://www.numerique.gouv.fr/dinum/"
18+
},
19+
{
20+
"label": "ZenDiS",
21+
"href": "https://zendis.de/"
22+
},
23+
{
24+
"label": "BlockNote.js",
25+
"href": "https://www.blocknotejs.org/"
5126
}
52-
},
53-
"fr": {
54-
"legalLinks": [
55-
{
56-
"label": "Mentions légales",
57-
"href": "#"
58-
},
59-
{
60-
"label": "Données personnelles et cookies",
61-
"href": "#"
62-
},
63-
{
64-
"label": "Accessibilité",
65-
"href": "#"
66-
}
67-
],
68-
"bottomInformation": {
69-
"label": "Sauf mention contraire, tout le contenu de ce site est sous",
70-
"link": {
71-
"label": "licence MIT",
72-
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
73-
}
27+
],
28+
"bottomInformation": {
29+
"label": "Unless otherwise stated, all content on this site is under",
30+
"link": {
31+
"label": "licence etalab-2.0",
32+
"href": "https://github.com/etalab/licence-ouverte/blob/master/LO.md"
7433
}
75-
},
76-
"de": {
77-
"legalLinks": [
78-
{
79-
"label": "Impressum",
80-
"href": "#"
81-
},
82-
{
83-
"label": "Personenbezogene Daten und Cookies",
84-
"href": "#"
85-
},
86-
{
87-
"label": "Barrierefreiheit",
88-
"href": "#"
89-
}
90-
],
91-
"bottomInformation": {
92-
"label": "Sofern nicht anders angegeben, steht der gesamte Inhalt dieser Website unter",
93-
"link": {
94-
"label": "licence MIT",
95-
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
96-
}
34+
}
35+
},
36+
"en": {
37+
"legalLinks": [
38+
{
39+
"label": "Legal Notice",
40+
"href": "#"
41+
},
42+
{
43+
"label": "Personal data and cookies",
44+
"href": "#"
45+
},
46+
{
47+
"label": "Accessibility",
48+
"href": "#"
9749
}
98-
},
99-
"nl": {
100-
"legalLinks": [
101-
{
102-
"label": "Wettelijke bepalingen",
103-
"href": "#"
104-
},
105-
{
106-
"label": "Persoonlijke gegevens en cookies",
107-
"href": "#"
108-
},
109-
{
110-
"label": "Toegankelijkheid",
111-
"href": "#"
112-
}
113-
],
114-
"bottomInformation": {
115-
"label": "Tenzij anders vermeld, is alle inhoud van deze site ondergebracht onder",
116-
"link": {
117-
"label": "licence MIT",
118-
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
119-
}
50+
],
51+
"bottomInformation": {
52+
"label": "Unless otherwise stated, all content on this site is under",
53+
"link": {
54+
"label": "licence MIT",
55+
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
56+
}
57+
}
58+
},
59+
"fr": {
60+
"legalLinks": [
61+
{
62+
"label": "Mentions légales",
63+
"href": "#"
64+
},
65+
{
66+
"label": "Données personnelles et cookies",
67+
"href": "#"
68+
},
69+
{
70+
"label": "Accessibilité",
71+
"href": "#"
72+
}
73+
],
74+
"bottomInformation": {
75+
"label": "Sauf mention contraire, tout le contenu de ce site est sous",
76+
"link": {
77+
"label": "licence MIT",
78+
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
79+
}
80+
}
81+
},
82+
"de": {
83+
"legalLinks": [
84+
{
85+
"label": "Impressum",
86+
"href": "#"
87+
},
88+
{
89+
"label": "Personenbezogene Daten und Cookies",
90+
"href": "#"
91+
},
92+
{
93+
"label": "Barrierefreiheit",
94+
"href": "#"
95+
}
96+
],
97+
"bottomInformation": {
98+
"label": "Sofern nicht anders angegeben, steht der gesamte Inhalt dieser Website unter",
99+
"link": {
100+
"label": "licence MIT",
101+
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
102+
}
103+
}
104+
},
105+
"nl": {
106+
"legalLinks": [
107+
{
108+
"label": "Wettelijke bepalingen",
109+
"href": "#"
110+
},
111+
{
112+
"label": "Persoonlijke gegevens en cookies",
113+
"href": "#"
114+
},
115+
{
116+
"label": "Toegankelijkheid",
117+
"href": "#"
118+
}
119+
],
120+
"bottomInformation": {
121+
"label": "Tenzij anders vermeld, is alle inhoud van deze site ondergebracht onder",
122+
"link": {
123+
"label": "licence MIT",
124+
"href": "https://github.com/suitenumerique/docs/blob/main/LICENSE"
120125
}
121126
}
122127
}
123128
}
124-
129+
}

src/frontend/apps/e2e/__tests__/app-impress/config.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ test.describe('Config: Not loggued', () => {
159159
const jsonResponse = await response.json();
160160
expect(jsonResponse.FRONTEND_THEME).toStrictEqual('default');
161161

162-
const footer = page.locator('footer').first();
162+
const header = page.locator('header').first();
163163
// alt 'Gouvernement Logo' comes from the theme
164-
await expect(footer.getByAltText('Gouvernement Logo')).toBeVisible();
164+
await expect(header.getByAltText('Gouvernement Logo')).toBeVisible();
165165
});
166166
});

0 commit comments

Comments
 (0)