From 747650b2660823ed9f862d89414e9b8a66ca8cd4 Mon Sep 17 00:00:00 2001 From: Nico Prananta Date: Thu, 21 Jan 2016 15:41:12 +0100 Subject: [PATCH] fix download button when direct. fix js when no baseurl --- _plugins/download.rb | 2 +- js/main.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_plugins/download.rb b/_plugins/download.rb index 0297d71..f519a1d 100644 --- a/_plugins/download.rb +++ b/_plugins/download.rb @@ -19,7 +19,7 @@ def initialize(tag_name, text, tokens) def render(context) site = context.registers[:site] - @img = site.baseurl + @img + @img = site.baseurl + (@img ? @img : "") if @url.length > 0 if @text rendered = "

"+@text+"

" diff --git a/js/main.js b/js/main.js index ef3d24b..79f5972 100755 --- a/js/main.js +++ b/js/main.js @@ -371,7 +371,11 @@ if (qs["fr"] > 0) { window.history.back(); } else { - window.location = {{ site.baseurl }}; + {% if site.baseurl == '' %} + window.location = '/'; + {% else %} + window.location = {{ site. baseurl }}; + {% endif %} } }); }