From c51de263be9be3639ea75e43664d1d89adc1c2d1 Mon Sep 17 00:00:00 2001 From: Michael Ghens Date: Thu, 27 Feb 2020 08:22:49 -0800 Subject: [PATCH] Fix gallery path for windows python On Windows 10 anaconda python, this plugin uses "\" or "%5C" instead of "/" between site/galleries and gallery name. Kludge fix. --- v7/gallery_directive/gallery_directive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v7/gallery_directive/gallery_directive.py b/v7/gallery_directive/gallery_directive.py index 67de7fc6..8b2b9bdd 100644 --- a/v7/gallery_directive/gallery_directive.py +++ b/v7/gallery_directive/gallery_directive.py @@ -78,6 +78,8 @@ def run(self): for img in photo_array: img['url'] = '/' + '/'.join([gallery_folder, img['url']]) img['url_thumb'] = '/' + '/'.join([gallery_folder, img['url_thumb']]) + img['url'] = img['url'].replace("\\","/") + img['url_thumb'] = img['url_thumb'].replace("\\","/") photo_array_json = json.dumps(photo_array) context = {} context['description'] = ''