Skip to content

Commit

Permalink
cleaned up css/js loading (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Sep 19, 2018
1 parent 2c194e4 commit ad035f8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 31 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
- kombu=3.0
# mongodb
- pymongo=3
- mongodb=3.4
- mongodb>=3.4
# twitcher
- webob
- argcomplete
Expand Down
Binary file modified phoenix/static/favicon.ico
Binary file not shown.
48 changes: 26 additions & 22 deletions phoenix/templates/layouts/default.pt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- deform: https://github.com/Pylons/deform -->
<!-- link rel="stylesheet" href="${request.static_path('deform:static/css/bootstrap.min.css')}"/ -->
<!-- link rel="stylesheet" href="${request.static_path('deform:static/css/pygments.css')}"/ -->
<link rel="stylesheet" href="${request.static_path('deform:static/css/form.css')}"/>
<!-- link rel="stylesheet" href="${request.static_path('deform:static/css/form.css')}"/ -->
<!-- link rel="stylesheet" href="${request.static_path('deform:static/select2/select2.css')}"/ -->
<!-- link rel="stylesheet" href="${request.static_path('deform:static/css/beautify.css')}"/ -->
<!-- link rel="stylesheet" href="${request.static_path('deform:static/css/typeahead.css')}"/ -->
Expand All @@ -32,6 +32,7 @@
<!-- Phoenix Theme CSS -->
<link rel="stylesheet" href="${request.static_path('phoenix:static/phoenix/css/theme/default.css')}"/>


<tal:block repeat="reqt css_links|[]">
<link rel="stylesheet" href="${request.static_path(reqt)}" type="text/css" />
</tal:block>
Expand All @@ -50,29 +51,9 @@
type="text/javascript"></script -->
<script src="${request.static_path('phoenix:static/jquery/js/jquery-3.3.1.min.js')}"
type="text/javascript"></script>

<script src="${request.static_path('deform:static/scripts/deform.js')}"
type="text/javascript"></script>
<script src="${request.static_path('deform:static/scripts/modernizr.custom.input-types-and-atts.js')}"
type="text/javascript"></script>
<!-- ... bootstrap -->
<!-- script src="${request.static_path('deform:static/scripts/bootstrap.min.js')}"
type="text/javascript"></script -->
<script src="${request.static_path('phoenix:static/bootstrap/js/bootstrap.min.js')}"
type="text/javascript"></script>
<script src="${request.static_path('deform:static/scripts/jquery.form-3.09.js')}"
type="text/javascript"></script>
<!-- script src="${request.static_path('deform:static/select2/select2.js')}"
type="text/javascript"></script -->
<script src="${request.static_path('deform:static/pickadate/picker.js')}"
type="text/javascript"></script>
<script src="${request.static_path('deform:static/pickadate/picker.date.js')}"
type="text/javascript"></script>
<script src="${request.static_path('deform:static/pickadate/picker.time.js')}"
type="text/javascript"></script>
<!-- script src="${request.static_path('deform:static/scripts/file_upload.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/scripts/typeahead.min.js')}"
type="text/javascript"></script -->

<!-- JavaScript: js_preload slot used by template
======================================================================= -->
Expand All @@ -99,6 +80,29 @@
======================================================================= -->
<!-- Placed at the end of the document so the pages load faster -->

<!-- script src="${request.static_path('deform:static/scripts/modernizr.custom.input-types-and-atts.js')}"
type="text/javascript"></script -->

<!-- ... bootstrap -->
<!-- script src="${request.static_path('deform:static/scripts/bootstrap.min.js')}"
type="text/javascript"></script -->
<script src="${request.static_path('phoenix:static/bootstrap/js/bootstrap.min.js')}"
type="text/javascript"></script>
<!-- script src="${request.static_path('deform:static/scripts/jquery.form-3.09.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/select2/select2.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/pickadate/picker.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/pickadate/picker.date.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/pickadate/picker.time.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/scripts/file_upload.js')}"
type="text/javascript"></script -->
<!-- script src="${request.static_path('deform:static/scripts/typeahead.min.js')}"
type="text/javascript"></script -->

<tal:block repeat="reqt js_links|[]">
<script type="text/javascript" src="${request.static_path(reqt)}"></script>
</tal:block>
Expand Down
24 changes: 16 additions & 8 deletions templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ server {
listen ${http_port};
server_name ${hostname};

# gzip
# https://www.nginx.com/resources/admin-guide/compression-and-decompression/
gzip on;
gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
# gunzip on;

# redirect to https
location / {
rewrite ^ https://$server_name:${https_port}$request_uri?;
Expand Down Expand Up @@ -47,6 +39,22 @@ server
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 1m;

# gzip
# https://www.nginx.com/resources/admin-guide/compression-and-decompression/
gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

# Disable for IE < 6 because there are some known problems
gzip_disable "MSIE [1-6].(?!.*SV1)";

# Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
gzip_vary on;

# Phoenix app
location /
{
Expand Down

0 comments on commit ad035f8

Please sign in to comment.