Commit 52484207 authored by Maxime Chaillet's avatar Maxime Chaillet

add documentation field in the object used by google for indexing. It fixes...

add documentation field in the object used by google for indexing. It fixes #66.
parent ed833524
This diff is collapsed.
......@@ -173,11 +173,20 @@ DOIController.prototype.getDataForGoogleSearch = function (doi) {
type: "GET",
timeout: 15000,
url: 'https://data.datacite.org/' + doi,
dataType: 'text', // don't convert JSON to Javascript object
//dataType: 'text', // don't convert JSON to Javascript object
success: function (data) {
debugger;
if (data) {
_this.view.addDOIMetadataToHead(data);
} else{
// Here we add the documentation field in the recieved object because 'name' and 'documentation' fileds are required by google dataset search.
if (data.name) {
if (!data.documentation) {
data.documentation = data.name;
}
_this.view.addDOIMetadataToHead(JSON.stringify(data));
} else {
console.log("[GOOGLE SEARCH INDEXING] - The data required by Google is missing the 'name' field. This is required by Google for indexing.");
}
} else {
console.log("[GOOGLE SEARCH INDEXING] - No metadata recieved from datacite.");
}
},
......
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