mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Compare commits
2 Commits
02c77a5e31
...
6171d1d2e1
Author | SHA1 | Date | |
---|---|---|---|
|
6171d1d2e1 | ||
|
0c948561a8 |
|
@ -1,5 +1,6 @@
|
|||
from . import filters
|
||||
from ..pkg_global.conf import malojaconfig
|
||||
from ..pkg_global import conf
|
||||
|
||||
from .. import database, malojatime, images, malojauri, thirdparty, __pkginfo__
|
||||
from ..database import jinjaview
|
||||
|
@ -32,6 +33,7 @@ def update_jinja_environment():
|
|||
"mlj_uri": malojauri,
|
||||
"settings": malojaconfig,
|
||||
"thirdparty": thirdparty,
|
||||
"conf":conf,
|
||||
"pkginfo": __pkginfo__,
|
||||
# external
|
||||
"urllib": urllib,
|
||||
|
|
|
@ -326,6 +326,9 @@ config(
|
|||
|
||||
|
||||
|
||||
custom_css_files = [f for f in os.listdir(data_dir['css']()) if f.lower().endswith('.css')]
|
||||
|
||||
|
||||
|
||||
# what the fuck did i just write
|
||||
# this spaghetti file is proudly sponsored by the rice crackers i'm eating at the
|
||||
|
|
|
@ -182,6 +182,15 @@ def static(path):
|
|||
response.set_header("Cache-Control", "public, max-age=3600")
|
||||
return response
|
||||
|
||||
# static files not supplied by the package
|
||||
@webserver.get("/static_custom/<category>/<path:path>")
|
||||
def static_custom(category,path):
|
||||
rootpath = {
|
||||
'css':data_dir['css']()
|
||||
}
|
||||
response = static_file(path,root=rootpath[category])
|
||||
response.set_header("Cache-Control", "public, max-age=3600")
|
||||
return response
|
||||
|
||||
|
||||
### DYNAMIC
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
<link rel="stylesheet" href="/maloja.css" />
|
||||
<link rel="stylesheet" href="/static/css/themes/{{ settings.theme }}.css" />
|
||||
{% for cssf in conf.custom_css_files %}
|
||||
<link rel="stylesheet" href="/static_custom/css/{{ cssf }}" />
|
||||
{% endfor %}
|
||||
|
||||
<script src="/search.js"></script>
|
||||
<script src="/neopolitan.js"></script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user