Commit 2e64806f authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue80' into 'master'

Issue80

Closes #80

See merge request !101
parents 0acf900d a5024e32
Pipeline #16153 passed with stages
in 1 minute and 58 seconds
This diff is collapsed.
......@@ -80,6 +80,10 @@ DOIController.prototype.render = function (doi, data) {
// Create a table containing unique tuples [proposal, beamline, beamlineUrl]
doiData.mergedProposalBeamlines = jsonExtractor.getMergedProposalAndBeamline(proposalNames, beamlines, doiData.beamlineUrls);
// Set user specific canonical URL for this page.
_this.view.addCanonicalURLToHead('https://doi.esrf.fr/' + doiData.doi);
// send to dust render
_this.view.renderDOIData(doiData);
}
......
......@@ -184,4 +184,15 @@ DOIView.prototype.addDOIMetadataToHead = function (data) {
.attr('type', 'application/ld+json')
.text(data)
.appendTo('head');
};
/**
* Add a link html element to specify the user-selected canonical URL for this page.
* @param {String} doiURL URL to the DOI
*/
DOIView.prototype.addCanonicalURLToHead = function (doiURL) {
$('<link>')
.attr('rel', 'canonical')
.attr('href', doiURL)
.appendTo('head');
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment