feat: Protection des données des associations

This commit is contained in:
Simon 2022-12-02 13:03:00 +01:00
parent 5535a90e8d
commit 7f2fab4263
2 changed files with 23 additions and 18 deletions

View File

@ -10,9 +10,9 @@
<div class="container md"> <div class="container md">
<h2>Liens :</h2> <h2>Liens :</h2>
<ul> <ul>
{{ if .Params.mail }}<li>Mail : {{ .Params.mail }}</li>{{ end }} {{ if .Params.mail }}<li>Mail : {{ printf "[%s](mailto:%s)" .Params.mail .Params.mail | markdownify }}</li>{{ end }}
{{ if .Params.telephone }}<li>Téléphone : {{ .Params.telephone }}</li>{{ end }} {{ if .Params.telephone }}<li>Téléphone : {{ printf "[%s](tel:%s)" (replace .Params.telephone " " "") (replace .Params.telephone " " "") | markdownify }}</li>{{ end }}
{{ if .Params.site }}<li>Site WEB : {{ .Params.site }}</li>{{ end }} {{ if .Params.site }}<li>Site WEB : <a href="{{ .Params.site }}">{{ .Params.site }}</a></li>{{ end }}
{{ if .Params.facebook }}<li>Facebook : {{ .Params.facebook }}</li>{{ end }} {{ if .Params.facebook }}<li>Facebook : {{ .Params.facebook }}</li>{{ end }}
</ul> </ul>
</div> </div>

View File

@ -34,6 +34,8 @@ const config = {
if (!association.title) { if (!association.title) {
association.title = association.denomination association.title = association.denomination
} }
if (association.bureau && association.bureau.length > 0) {
console.log(association.bureau.length)
const bureau = [] const bureau = []
for (const contact of association.bureau) { for (const contact of association.bureau) {
const detail = contact.Contact_id const detail = contact.Contact_id
@ -51,6 +53,9 @@ const config = {
bureau.push(c) bureau.push(c)
} }
association.bureau = bureau association.bureau = bureau
} else {
delete association.bureau
}
return `./content/associations/${urlslug(association.denomination)}`; return `./content/associations/${urlslug(association.denomination)}`;
}, },