diff --git a/python/src/stackdump/app.py b/python/src/stackdump/app.py index 1163d84..6043781 100644 --- a/python/src/stackdump/app.py +++ b/python/src/stackdump/app.py @@ -410,7 +410,8 @@ def view_question(site_key, question_id, answer_id=None): result = results.docs[0] convert_comments_to_html(result) - rewrite_result(result) + if settings.REWRITE_LINKS_AND_IMAGES: + rewrite_result(result) sort_answers(result) context['result'] = result diff --git a/python/src/stackdump/default_settings.py b/python/src/stackdump/default_settings.py index cfa600e..a4a9fcc 100644 --- a/python/src/stackdump/default_settings.py +++ b/python/src/stackdump/default_settings.py @@ -32,6 +32,9 @@ NUM_OF_DEFAULT_COMMENTS = 3 # number of random questions to show on search query pages NUM_OF_RANDOM_QUESTIONS = 3 +# rewrite links and images to point internally or to a placeholder respectively +REWRITE_LINKS_AND_IMAGES = True + # settings that are available in templates TEMPLATE_SETTINGS = [ 'APP_URL_ROOT', diff --git a/python/src/stackdump/settings.py b/python/src/stackdump/settings.py index cafc02c..1430ebd 100644 --- a/python/src/stackdump/settings.py +++ b/python/src/stackdump/settings.py @@ -34,3 +34,6 @@ from default_settings import * # number of random questions to show on search query pages #NUM_OF_RANDOM_QUESTIONS = 3 + +# rewrite links and images to point internally or to a placeholder respectively +#REWRITE_LINKS_AND_IMAGES = True