-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(share, follow, utility): icone personalisée, et ajout twitter-…
…x et threads [DS-3530] (#752) - ajoute la possibilité de mettre une icone de réseau social personalisée dans "follow" - ajouts d'exemples d'icone personalisée dans "share" et "follow" - ajouts des icones dans utility : - twitter-x-fill - twitter-x-line - threads-fill - threads-line
- Loading branch information
Showing
14 changed files
with
144 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<% | ||
const metaTag = [ | ||
{ | ||
// Format de la card twitter de partage (large ou résumé) | ||
name: 'twitter:card', | ||
content: 'summary_large_image' // ou 'summary' si non défini | ||
}, | ||
{ | ||
// Nom du compte twitter lié à la page partagée ('@username') | ||
name: 'twitter:site', | ||
content: contentPlaceholder('@usernameTwitter') | ||
}, | ||
{ | ||
// titre de la page partagée | ||
property: 'og:title', | ||
content: contentPlaceholder('Système de Design de l\'État') | ||
}, | ||
{ | ||
// Description du contenu de la page / de l'article | ||
property: 'og:description', | ||
content: contentPlaceholder('Développer vos sites et applications en utilisant des composants prêts à l\'emploi, accessibles et ergonomiques') | ||
}, | ||
{ | ||
// url d'une image pour illustrer le contenu de la page | ||
property: 'og:image', | ||
content: contentPlaceholder('https://systeme-de-design.gouv.fr/src/img/systeme-de-design.gouv.fr.jpg') | ||
}, | ||
{ | ||
// Type de contenu (généralement 'website', éventuellement 'article') | ||
property: 'og:type', | ||
content: 'website' | ||
}, | ||
{ | ||
// Adresse url du site | ||
property: 'og:url', | ||
content: contentPlaceholder('https://systeme-de-design.gouv.fr/') | ||
}, | ||
{ | ||
// Nom complet du site | ||
property: 'og:site_name', | ||
content: contentPlaceholder('Site officiel du Système de Design de l\'État') | ||
}, | ||
{ | ||
// texte alternatif de l'image | ||
property: 'og:image:alt', | ||
content: contentPlaceholder('République Française - Système de Design de l\'État') | ||
}, | ||
{ | ||
// texte alternatif de l'image pour twitter | ||
name: 'twitter:image:alt', | ||
content: contentPlaceholder('République Française - Système de Design de l\'État') | ||
} | ||
]; | ||
%> | ||
|
||
<%- JSON.stringify(metaTag); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<% | ||
let share = locals.share || {}; | ||
let data = {}; | ||
data.share = { | ||
id: uniqueId('share'), | ||
title: 'Partager la page', | ||
text: 'Veuillez <a href=' + contentPlaceholder("url page autorisation cookies") + '>autoriser le dépôt de cookies</a> pour partager sur Facebook, Twitter et LinkedIn.', | ||
disabled: share.disabled === true, | ||
buttons: [ | ||
{ | ||
id: uniqueId('share'), | ||
type: 'facebook', | ||
label: 'Partager sur Facebook', | ||
url: `https://www.facebook.com/sharer.php?u=${contentPlaceholder('url de la page')}`, | ||
width: 600, | ||
height: 450 | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'twitter', | ||
label: 'Partager sur Twitter', | ||
url: `https://twitter.com/intent/tweet?url=${contentPlaceholder('url de la page')}&text=${contentPlaceholder('titre ou texte descriptif de la page')}&via=${contentPlaceholder('via')}&hashtags=${contentPlaceholder('hashtags')}`, | ||
width: 600, | ||
height: 420, | ||
comments: !share.disabled ? 'Les paramètres de la reqûete doivent être URI-encodés (ex: encodeURIComponent() en js)': undefined | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'linkedin', | ||
label: 'Partager sur LinkedIn', | ||
url: `https://www.linkedin.com/shareArticle?url=${contentPlaceholder('url de la page')}&title=${contentPlaceholder('titre ou texte descriptif de la page')}`, | ||
width: 550, | ||
height: 550 | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'mail', | ||
label: 'Partager par email', | ||
url: `mailto:?subject=${contentPlaceholder('objet du mail')}&body=${contentPlaceholder('titre ou texte descriptif de la page')} ${contentPlaceholder('url de la page')}` | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'copy', | ||
label: 'Copier dans le presse-papier', | ||
onclick: `navigator.clipboard.writeText(window.location).then(function() {alert('Adresse copiée dans le presse papier.')});` // @TODO: ajouter un polyfill pour IE11 | ||
} | ||
] | ||
} %> | ||
|
||
<%- JSON.stringify(data); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,6 @@ | ||
<% | ||
const metaTag = [ | ||
{ | ||
// Format de la card twitter de partage (large ou résumé) | ||
name: 'twitter:card', | ||
content: 'summary_large_image' // ou 'summary' si non défini | ||
}, | ||
{ | ||
// Nom du compte twitter lié à la page partagée ('@username') | ||
name: 'twitter:site', | ||
content: contentPlaceholder('@usernameTwitter') | ||
}, | ||
{ | ||
// titre de la page partagée | ||
property: 'og:title', | ||
content: contentPlaceholder('Système de Design de l\'État') | ||
}, | ||
{ | ||
// Description du contenu de la page / de l'article | ||
property: 'og:description', | ||
content: contentPlaceholder('Développer vos sites et applications en utilisant des composants prêts à l\'emploi, accessibles et ergonomiques') | ||
}, | ||
{ | ||
// url d'une image pour illustrer le contenu de la page | ||
property: 'og:image', | ||
content: contentPlaceholder('https://systeme-de-design.gouv.fr/src/img/systeme-de-design.gouv.fr.jpg') | ||
}, | ||
{ | ||
// Type de contenu (généralement 'website', éventuellement 'article') | ||
property: 'og:type', | ||
content: 'website' | ||
}, | ||
{ | ||
// Adresse url du site | ||
property: 'og:url', | ||
content: contentPlaceholder('https://systeme-de-design.gouv.fr/') | ||
}, | ||
{ | ||
// Nom complet du site | ||
property: 'og:site_name', | ||
content: contentPlaceholder('Site officiel du Système de Design de l\'État') | ||
}, | ||
{ | ||
// texte alternatif de l'image | ||
property: 'og:image:alt', | ||
content: contentPlaceholder('République Française - Système de Design de l\'État') | ||
}, | ||
{ | ||
// texte alternatif de l'image pour twitter | ||
name: 'twitter:image:alt', | ||
content: contentPlaceholder('République Française - Système de Design de l\'État') | ||
} | ||
]; | ||
let metaTag = []; | ||
metaTag = JSON.parse(include('../data/meta.json.ejs')); | ||
%> | ||
|
||
<%- include('../../template/ejs/share-meta', { meta: metaTag }); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,9 @@ | ||
|
||
<% | ||
let share = locals.share || {}; | ||
let data = {}; | ||
|
||
data.share = { | ||
id: uniqueId('share'), | ||
title: 'Partager la page', | ||
text: 'Veuillez <a href=' + contentPlaceholder("url page autorisation cookies") + '>autoriser le dépôt de cookies</a> pour partager sur Facebook, Twitter et LinkedIn.', | ||
disabled: share.disabled === true, | ||
buttons: [ | ||
{ | ||
id: uniqueId('share'), | ||
type: 'facebook', | ||
label: 'Partager sur Facebook', | ||
url: `https://www.facebook.com/sharer.php?u=${contentPlaceholder('url de la page')}`, | ||
width: 600, | ||
height: 450 | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'twitter', | ||
label: 'Partager sur Twitter', | ||
url: `https://twitter.com/intent/tweet?url=${contentPlaceholder('url de la page')}&text=${contentPlaceholder('titre ou texte descriptif de la page')}&via=${contentPlaceholder('via')}&hashtags=${contentPlaceholder('hashtags')}`, | ||
width: 600, | ||
height: 420, | ||
comments: !share.disabled ? 'Les paramètres de la reqûete doivent être URI-encodés (ex: encodeURIComponent() en js)': undefined | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'linkedin', | ||
label: 'Partager sur LinkedIn', | ||
url: `https://www.linkedin.com/shareArticle?url=${contentPlaceholder('url de la page')}&title=${contentPlaceholder('titre ou texte descriptif de la page')}`, | ||
width: 550, | ||
height: 550 | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'mail', | ||
label: 'Partager par email', | ||
url: `mailto:?subject=${contentPlaceholder('objet du mail')}&body=${contentPlaceholder('titre ou texte descriptif de la page')} ${contentPlaceholder('url de la page')}` | ||
}, | ||
{ | ||
id: uniqueId('share'), | ||
type: 'copy', | ||
label: 'Copier dans le presse-papier', | ||
onclick: `navigator.clipboard.writeText(window.location).then(function() {alert('Adresse copiée dans le presse papier.')});` // @TODO: ajouter un polyfill pour IE11 | ||
} | ||
] | ||
} %> | ||
|
||
<% | ||
let data = {}; | ||
data = JSON.parse(include('../data/share.json.ejs')); | ||
%> | ||
|
||
<%- include('../../template/ejs/share', data); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.