Skip to content
Permalink
Browse files

Check if theme inherits from bootstrap3 and change if needed.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
Kwpolska committed Jan 12, 2015
1 parent ecb6367 commit 17c69cf6389ec2b0d2b2e8ca8ba4ea198a3839f8
Showing with 17 additions and 3 deletions.
  1. +17 −3 comet/web.py
@@ -103,9 +103,7 @@ def configure_site():
app._logger = get_logger('Comet', loghandlers)
app.http_logger = get_logger('CometHTTP', hloghandlers)

if site.configured:
scan_site()
else:
if not site.configured:
app.logger("Not a Nikola site.")
return

@@ -142,6 +140,22 @@ def configure_site():
<script src="/comet_assets/js/comet.js"></scripts>
"""

# Theme must inherit from bootstrap3, because we have hardcoded HTML for that.
bs3 = ('bootstrap3' in site.THEMES) or ('bootstrap3-jinja' in site.THEMES)
if not bs3:
app.logger.notice("THEME does not inherit from 'bootstrap3' or 'bootstrap3-jinja', using 'bootstrap3' instead.")
site.config['THEME'] = 'bootstrap3'
# Reloading some things
site._THEMES = None
site._get_themes()
site._template_system = None
site._get_template_system()
if 'has_custom_css' in site._GLOBAL_CONTEXT:
del site._GLOBAL_CONTEXT['has_custom_css']
site._get_global_context()

scan_site()

tmpl_dir = pkg_resources.resource_filename(
'comet', os.path.join('data', 'templates', site.template_system.name))
if os.path.isdir(tmpl_dir):

0 comments on commit 17c69cf

Please sign in to comment.
You can’t perform that action at this time.