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

Merge branch 'issue80' into 'master'

Issue80

Closes #80

See merge request icat/doi-landing-page!101
parents 0acf900d a5024e32
This diff is collapsed.
...@@ -80,6 +80,10 @@ DOIController.prototype.render = function (doi, data) { ...@@ -80,6 +80,10 @@ DOIController.prototype.render = function (doi, data) {
// Create a table containing unique tuples [proposal, beamline, beamlineUrl] // Create a table containing unique tuples [proposal, beamline, beamlineUrl]
doiData.mergedProposalBeamlines = jsonExtractor.getMergedProposalAndBeamline(proposalNames, beamlines, doiData.beamlineUrls); 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 // send to dust render
_this.view.renderDOIData(doiData); _this.view.renderDOIData(doiData);
} }
......
...@@ -184,4 +184,15 @@ DOIView.prototype.addDOIMetadataToHead = function (data) { ...@@ -184,4 +184,15 @@ DOIView.prototype.addDOIMetadataToHead = function (data) {
.attr('type', 'application/ld+json') .attr('type', 'application/ld+json')
.text(data) .text(data)
.appendTo('head'); .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