Skip to content

Commit a781119

Browse files
committedAug 13, 2015
Resolve canonical link problem
1 parent 45b42dd commit a781119

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎output/index.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,17 @@ <h2>Plugins for Nikola <small>version
279279
// DEFAULT VERSION SET HERE
280280
var current_version = 7;
281281
var already_initialized = false;
282-
var canonical = 'https://plugins.getnikola.com/';
282+
var canonical = document.querySelector('link[rel="canonical"]');
283283
fetch(current_version);
284284
already_initialized = true;
285285
function hash_handler() {
286286
if (location.hash) {
287287
plugin = location.hash.slice(1);
288-
canonical = canonical + '#' + plugin;
288+
canonical.href = 'https://plugins.getnikola.com/#' + plugin;
289289
}
290290
else {
291-
plugin = null;
291+
canonical.href = 'https://plugins.getnikola.com/';
292292
}
293-
document.querySelector('link[rel="canonical"]').href=canonical;
294293
// Show plugin data
295294
container = $('#rightside');
296295
container.html('');

0 commit comments

Comments
 (0)
Please sign in to comment.