Layout: Add themes

This commit is contained in:
James Taylor
2019-08-25 15:25:24 -07:00
parent 609244e34f
commit e9b16ef71f
12 changed files with 79 additions and 21 deletions

View File

@@ -1,7 +1,22 @@
import flask
import settings
yt_app = flask.Flask(__name__)
yt_app.url_map.strict_slashes = False
@yt_app.route('/')
def homepage():
return flask.render_template('home.html', title="Youtube local")
theme_names = {
0: 'light_theme',
1: 'gray_theme',
2: 'dark_theme',
}
@yt_app.context_processor
def inject_theme_preference():
return {
'theme_path': '/youtube.com/static/' + theme_names[settings.theme] + '.css',
}