-
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.
- Loading branch information
Showing
20 changed files
with
629 additions
and
646 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.