@@ -198,7 +198,6 @@ function generateWorkCode(title, workUrl, isTitleDefault) {
198198 if ( isTitleDefault && ! workUrl ) {
199199 return title
200200 }
201-
202201 const titleMeta = 'property="dct:title"'
203202 if ( ! workUrl ) {
204203 return `<span ${ titleMeta } >${ title } </span>`
@@ -208,6 +207,15 @@ function generateWorkCode(title, workUrl, isTitleDefault) {
208207 return `<a ${ isTitleDefault ? '' : titleMeta } rel="cc:attributionURL" href="${ absoluteUrl } ">${ title } </a>`
209208}
210209
210+ /**
211+ * Generates the HTML for the rich text Year of Creation , including the year of Creation
212+ * @param {number } yearOfCreation
213+ * @returns {string }
214+ */
215+ function generateYearOfCreation ( yearOfCreation ) {
216+ const yearMeta = 'property="dct:title"'
217+ return `<span ${ yearMeta } > © ${ yearOfCreation } </span>`
218+ }
211219/**
212220 * Generates the html for the rich text license information, including license name,
213221 * link to the license deed, and license icons
@@ -235,11 +243,11 @@ function generateLicenseLink(licenseIcons, licenseUrl, licenseName) {
235243 * @param {ShortLicenseName } shortLicenseName
236244 * @param {Boolean } useFullName - Should the license name be full (short by default)
237245 * @param {Boolean } isTitleDefault
238- * @returns {{creator: string, work: string, license: string} }
246+ * @returns {{creator: string, work: string, license: string, year: string } }
239247 */
240248function generateHTML ( attributionDetails , shortLicenseName , useFullName = false , isTitleDefault = true ) {
241249 const data = { }
242- const { creatorName, creatorProfileUrl, workUrl, workTitle } = attributionDetails
250+ const { creatorName, creatorProfileUrl, workUrl, workTitle, yearOfCreation } = attributionDetails
243251
244252 const licenseSlug = slugFromShort ( shortLicenseName )
245253 const { ICONS : icons , URL : url , FULL : fullLicenseName } = LICENSES [ licenseSlug ]
@@ -248,6 +256,7 @@ function generateHTML(attributionDetails, shortLicenseName, useFullName = false,
248256 data . license = generateLicenseLink ( icons , url , licenseName )
249257 data . creator = generateCreatorCode ( creatorName , creatorProfileUrl )
250258 data . work = generateWorkCode ( workTitle , workUrl , isTitleDefault )
259+ data . year = generateYearOfCreation ( yearOfCreation )
251260 return data
252261}
253262
0 commit comments