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 . import filters
|
||||||
from ..pkg_global.conf import malojaconfig
|
from ..pkg_global.conf import malojaconfig
|
||||||
|
from ..pkg_global import conf
|
||||||
|
|
||||||
from .. import database, malojatime, images, malojauri, thirdparty, __pkginfo__
|
from .. import database, malojatime, images, malojauri, thirdparty, __pkginfo__
|
||||||
from ..database import jinjaview
|
from ..database import jinjaview
|
||||||
|
@ -32,6 +33,7 @@ def update_jinja_environment():
|
||||||
"mlj_uri": malojauri,
|
"mlj_uri": malojauri,
|
||||||
"settings": malojaconfig,
|
"settings": malojaconfig,
|
||||||
"thirdparty": thirdparty,
|
"thirdparty": thirdparty,
|
||||||
|
"conf":conf,
|
||||||
"pkginfo": __pkginfo__,
|
"pkginfo": __pkginfo__,
|
||||||
# external
|
# external
|
||||||
"urllib": urllib,
|
"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
|
# what the fuck did i just write
|
||||||
# this spaghetti file is proudly sponsored by the rice crackers i'm eating at the
|
# 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")
|
response.set_header("Cache-Control", "public, max-age=3600")
|
||||||
return response
|
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
|
### DYNAMIC
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
<link rel="stylesheet" href="/maloja.css" />
|
<link rel="stylesheet" href="/maloja.css" />
|
||||||
<link rel="stylesheet" href="/static/css/themes/{{ settings.theme }}.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="/search.js"></script>
|
||||||
<script src="/neopolitan.js"></script>
|
<script src="/neopolitan.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user