Skip to content

Commit 925a578

Browse files
committed
Merge branch '29-footer-links'
2 parents 5b4975d + fb0ff65 commit 925a578

File tree

9 files changed

+102
-19
lines changed

9 files changed

+102
-19
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ The following customizations can be made:
174174
1. Changing the Logo
175175
1. Changing the Colors
176176
1. Changing the Fonts
177+
1. Changing the Footer Links
177178

178179
#### Changing the Title
179180

@@ -222,6 +223,18 @@ After that you have to adjust the config with the appropriate settings for `font
222223
You need to provide all settings for `regular` as well as `bold`.
223224
Otherwise SkoHub Vocabs will use the default fonts.
224225

226+
#### Changing the Footer Links
227+
228+
You can - and probably should - change the following links
229+
230+
- "Impressum" (Imprint)
231+
- "Datenschutz" (Privacy)
232+
233+
in the footer section of your Skohub website by adding a custom `footer` object to your `config.yaml`. See `config.default.yaml` for how the default links are defined. You can also add more links as desired.
234+
235+
Currently, only the "Source" link cannot not be changed by configuration.
236+
237+
225238
## Adding additional properties to SkoHub Vocabs
226239

227240
If you need additional properties beside SKOS, here is how you add them:

config.default.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,17 @@ ui:
3737
font_style: "normal"
3838
font_weight: 700
3939
name: "ubuntu-v20-latin-700"
40+
footer:
41+
links:
42+
- title: "Impressum"
43+
url: "https://www.hbz-nrw.de/impressum"
44+
target: "_blank"
45+
rel: "noopener noreferrer"
46+
- title: "Datenschutz"
47+
url: "https://www.hbz-nrw.de/datenschutz"
48+
target: "_blank"
49+
rel: "noopener noreferrer"
50+
- title: "© SkoHub"
51+
url: "https://skohub.io"
52+
target: "_blank"
53+
rel: "noopener noreferrer"

gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
colors: config.colors,
1313
logo: config.logo,
1414
fonts: config.fonts,
15+
footer: config.footer,
1516
searchableAttributes: config.searchableAttributes,
1617
customDomain: config.customDomain,
1718
failOnValidation: config.failOnValidation,

src/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function loadConfig(configFile, defaultFile) {
139139
tokenizer: userConfig.tokenizer || defaults.tokenizer,
140140
colors: userConfig.ui.colors || defaults.ui.colors,
141141
fonts: userConfig.ui.fonts || defaults.ui.fonts,
142+
footer: userConfig.ui.footer || defaults.ui.footer,
142143
searchableAttributes:
143144
userConfig.searchableAttributes || defaults.searchableAttributes,
144145
customDomain: userConfig.custom_domain || "",

src/components/footer.jsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const Footer = () => {
4646
}
4747
}
4848
`
49+
50+
// Get links from config.yaml, if available
51+
const links = config?.footer?.links || []
52+
4953
return (
5054
<footer css={style}>
5155
<div className="footerContent">
@@ -61,25 +65,17 @@ const Footer = () => {
6165
</a>
6266
</li>
6367
)}
64-
<li className="push-right">
65-
<a
66-
href="https://www.hbz-nrw.de/impressum"
67-
target="_blank"
68-
rel="noopener noreferrer"
69-
>
70-
Impressum
71-
</a>
72-
</li>
73-
<li>
74-
&copy;{" "}
75-
<a
76-
href="https://skohub.io"
77-
target="_blank"
78-
rel="noopener noreferrer"
79-
>
80-
SkoHub
81-
</a>
82-
</li>
68+
{links.map((link, idx) => (
69+
<li key={idx} className={idx === 0 ? "push-right" : ""}>
70+
<a
71+
href={link.url}
72+
target={link.target || undefined}
73+
rel={link.rel || undefined}
74+
>
75+
{link.title}
76+
</a>
77+
</li>
78+
))}
8379
</ul>
8480
</div>
8581
</footer>

src/hooks/configAndConceptSchemes.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ export const getConfigAndConceptSchemes = () => {
7474
name
7575
}
7676
}
77+
footer {
78+
links {
79+
title
80+
url
81+
target
82+
rel
83+
}
84+
}
7785
searchableAttributes
7886
customDomain
7987
failOnValidation

test/config.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ describe("Config Parsing", () => {
4141
name: "alegreya-sans-v24-latin-700",
4242
},
4343
},
44+
footer: {
45+
links: [
46+
{
47+
title: "Impressum",
48+
url: "https://www.hbz-nrw.de/impressum",
49+
target: "_blank",
50+
rel: "noopener noreferrer",
51+
},
52+
{
53+
title: "Datenschutz",
54+
url: "https://www.hbz-nrw.de/datenschutz",
55+
target: "_blank",
56+
rel: "noopener noreferrer",
57+
},
58+
{
59+
title: "© SkoHub",
60+
url: "https://skohub.io",
61+
target: "_blank",
62+
rel: "noopener noreferrer",
63+
},
64+
],
65+
},
4466
})
4567
})
4668

test/data/config/config.default.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,17 @@ ui:
3030
font_style: "normal"
3131
font_weight: 700
3232
name: "ubuntu-v20-latin-700"
33+
footer:
34+
links:
35+
- title: "Impressum"
36+
url: "https://www.hbz-nrw.de/impressum"
37+
target: "_blank"
38+
rel: "noopener noreferrer"
39+
- title: "Datenschutz"
40+
url: "https://www.hbz-nrw.de/datenschutz"
41+
target: "_blank"
42+
rel: "noopener noreferrer"
43+
- title: "© SkoHub"
44+
url: "https://skohub.io"
45+
target: "_blank"
46+
rel: "noopener noreferrer"

test/data/config/config.test.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@ ui:
2626
font_style: "normal"
2727
font_weight: 700
2828
name: "alegreya-sans-v24-latin-700"
29+
footer:
30+
links:
31+
- title: "Impressum"
32+
url: "https://www.hbz-nrw.de/impressum"
33+
target: "_blank"
34+
rel: "noopener noreferrer"
35+
- title: "Datenschutz"
36+
url: "https://www.hbz-nrw.de/datenschutz"
37+
target: "_blank"
38+
rel: "noopener noreferrer"
39+
- title: "© SkoHub"
40+
url: "https://skohub.io"
41+
target: "_blank"
42+
rel: "noopener noreferrer"

0 commit comments

Comments
 (0)