forked from I2P_Developers/i2p.www
Temporarily enable loading of an externally-hosted CSS file
This commit is contained in:
@@ -87,6 +87,11 @@ def detect_theme():
|
||||
theme = request.cookies['style']
|
||||
if 'theme' in request.args.keys():
|
||||
theme = request.args['theme']
|
||||
# TEMPORARY: enable external themes
|
||||
# TODO: Remove this (and the corresponding lines in global/layout.html
|
||||
if theme[:7] == 'http://':
|
||||
g.exttheme = theme
|
||||
theme = 'duck'
|
||||
if not os.path.isfile(safe_join(safe_join(STATIC_DIR, 'styles'), '%s.css' % theme)):
|
||||
theme = 'duck'
|
||||
g.theme = theme
|
||||
|
@@ -5,7 +5,9 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title_outer %}{% block title %}{% endblock %} - I2P{% endblock %}</title>
|
||||
<link rel="canonical" href="{{ canonical() }}" />
|
||||
{% if g.exttheme %}<link rel="stylesheet" type="text/css" href="{{ g.exttheme }}" title="External theme" />{% else -%}
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/' + g.theme + '.css') }}" title="{{ g.theme }}" />
|
||||
{%- endif %}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" />
|
||||
<meta name="robots" content="NOODP" />
|
||||
{%- block headextra %}{% endblock %}
|
||||
|
Reference in New Issue
Block a user