Commit 92959f37 authored by Maxime Chaillet's avatar Maxime Chaillet

use external rendertron to prerender pages for googlebots. Put the data...

use external rendertron to prerender pages for googlebots. Put the data structure into the HEAD instead of the body.
parent ef6b8007
......@@ -6,4 +6,12 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.js)
RewriteCond %{REQUEST_URI} !(\.css)
RewriteCond %{REQUEST_URI} !(images/)
RewriteCond %{HTTP_USER_AGENT} !googlebot [NC]
RewriteRule "/(.+)$" "index.html?DOI=$1" [NC,L]
# P requires that the apache libs 'proxy_http' and 'proxy' is loaded
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
# RewriteRule "(.+)$" "http://localhost:3002/render/http://%{HTTP_HOST}/$1" [P,L]
# RewriteRule "(.+)$" "https://render-tron.appspot.com/render/http://%{HTTP_HOST}/$1" [P,L]
RewriteRule "(.+)$" "http://render-tron.appspot.com/render/http://doi.esrf.fr/$1" [P,L]
......@@ -41,7 +41,7 @@
</script>
</head>
<body id='test' >
<body>
<div class="align-items-center blueBackground" style="display:flex; flex-wrap: wrap">
<div style="flex: 0 0 auto; padding-left: 10px;">
<img id="logo" style="height:80px;" src="/src/images/esrflogo.png" alt="the ESRF logo">
......
This diff is collapsed.
......@@ -180,19 +180,8 @@ DOIView.prototype.setDataAccessMessage = function (doiData) {
* @param {string} data doi metadata in Json+LD format as provided by datacite.
*/
DOIView.prototype.addDOIMetadataToHead = function (data) {
// $('#test').append(
// $('<script>')
// .attr('type', 'application/ld+json')
// .text(data)
// );
var scriptNode = document.createElement('script');
scriptNode.type = 'application/ld+json';
scriptNode.text = data;
document.getElementById('test').appendChild(scriptNode);
// $('<script>')
// .attr('type', 'application/ld+json')
// .text(data)
// .appendTo('head');
$('<script>')
.attr('type', 'application/ld+json')
.text(data)
.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