process all assets thru doit

This commit is contained in:
codl 2017-08-11 16:41:31 +02:00
parent d6c45a73a6
commit dd212ce1c3
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
6 changed files with 28 additions and 2 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
__pycache__
celerybeat-schedule
.doit.db
static/logotype*.png
static/

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

24
dodo.py
View File

@ -21,6 +21,30 @@ def task_gen_logo():
'file_dep': ['assets/logotype.png'],
}
def task_copy_icon():
import shutil
return {
'actions': [lambda: shutil.copy('assets/icon.png', 'static/icon.png')],
'targets': ['static/icon.png'],
'file_dep': ['assets/icon.png'],
}
def task_minify_css():
"""minify css"""
from csscompressor import compress
def minify():
with open('assets/styles.css') as in_:
with open('static/styles.css', 'w') as out:
out.write(compress(in_.read()))
return {
'actions': [minify],
'targets': ['static/styles.css'],
'file_dep': ['assets/styles.css'],
}
if __name__ == '__main__':
import doit
doit.run(globals())

View File

@ -6,6 +6,7 @@ celery==4.1.0
click==6.7
cloudpickle==0.4.0
contextlib2==0.5.5
csscompressor==0.9.4
doit==0.30.3
Flask==0.12.2
Flask-Limiter==0.9.5

View File

@ -2,7 +2,7 @@
<html lang=en prefix='og: http://ogp.me/ns#'>
<head>
<title>Forget</title>
<link rel='stylesheet' href='{{ st("style.css") }}' />
<link rel='stylesheet' href='{{ st("styles.css") }}' />
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='icon' href='{{ st("icon.png") }}' />
<meta name='og:title' content='Forget'/>