Browse Source

Use gzip compression wherever possible

master
Noah Petherbridge 2 years ago
parent
commit
2a3bb3bdef
3 changed files with 4 additions and 1 deletions
  1. 1
    0
      requirements.txt
  2. 2
    0
      rophako/app.py
  3. 1
    1
      rophako/modules/blog/templates/blog/entry.inc.html

+ 1
- 0
requirements.txt View File

@@ -1,4 +1,5 @@
1 1
 flask
2
+flask-compress
2 3
 flask-sslify
3 4
 redis
4 5
 pytz

+ 2
- 0
rophako/app.py View File

@@ -6,6 +6,7 @@ from __future__ import unicode_literals, absolute_import
6 6
 from flask import (Flask, g, request, session, render_template, send_file,
7 7
     abort, redirect)
8 8
 from flask_sslify import SSLify
9
+from flask_compress import Compress
9 10
 import jinja2
10 11
 import os.path
11 12
 import datetime
@@ -16,6 +17,7 @@ import sys
16 17
 app = Flask(__name__,
17 18
     static_url_path="/.static",
18 19
 )
20
+Compress(app)
19 21
 
20 22
 # We use a custom Jinja loader to support multiple template paths for custom
21 23
 # and default templates. The base list of template paths to check includes

+ 1
- 1
rophako/modules/blog/templates/blog/entry.inc.html View File

@@ -41,7 +41,7 @@
41 41
 	{{ post["rendered_body"] | safe }}
42 42
 	{% if post["snipped"] %}
43 43
 		<p>
44
-		<a href="{{ url_for('blog.entry', fid=post['fid']) }}">Read more...</a>
44
+		<a href="{{ url_for('blog.entry', fid=post['fid']) }}#snip">Read more...</a>
45 45
 	{% endif %}
46 46
 
47 47
 	<p>

Loading…
Cancel
Save