aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-06-09 16:15:08 -0400
committermjfernez <mjfernez@gmail.com>2021-06-09 16:15:08 -0400
commite6da718cae160800832d0df7e8d81610ba376e3d (patch)
treeb5f0e8e70a5060f5d730e580dbce5a91e62153fc
parent85b8737e96860a9e0c957e8117efad1c18adc11c (diff)
downloadezcms-e6da718cae160800832d0df7e8d81610ba376e3d.tar.gz
PEP8 and README tweaks
Fixes PEP8 formatting because apparently coala messed this up. Added some clarifying notes in the README.
-rw-r--r--README44
-rw-r--r--server.py16
2 files changed, 31 insertions, 29 deletions
diff --git a/README b/README
index 7889bc2..ddc1932 100644
--- a/README
+++ b/README
@@ -58,6 +58,8 @@ $ python server.py
```
Your server will (by default) be hosted on http://127.0.0.1:5000
+and have the `templates/site/` directory mounted. You should see `home.html`
+render.
## Adding Pages
@@ -84,6 +86,25 @@ any template you've developed for flask is fully usable here--but remember it
will be rendered *inside* the `templates/base.html` template. If you need to
make tweaks to the navbar or footer, you'll want to edit that file instead.
+### Override base template
+
+Have a page with custom CSS, or need to get rid of the navbar entirely? No
+worries! Just add a '!' at the end of you html file and EZCMS will interpret it
+as it's own Jinja template without adding everything from the base template.
+Tip: if you're just changing the CSS, you can start with the following
+boilerplate that I provide in `base.html`:
+
+
+```code
+{% extends 'base.html' %}
+{% block css%}
+//your cool css here
+{% endblock %}
+{% block content %}
+//your cool content here
+{% endblock %}
+```
+
## Customization (or things you'll want to change right now)
@@ -123,34 +144,15 @@ example this line:
`About,/about`
-Produces (roughly) the following HTML on your index page:
+Produces the following HTML on your index page:
-`<li><a href="/about">About</a></li>`
+`<li><a href="/about" target="_blank" rel="noopener noreferrer>About</a></li>`
You can of course link to external sites, but you must specify the protocol
(i.e. https://google.com, not google.com). Otherwise, it will be interpreted as
a relative path like `example.net/google.com`.
-### Override base template
-
-Have a page with custom CSS, or need to get rid of the navbar entirely? No
-worries! Just add a '!' at the end of you html file and EZCMS will interpret it
-as it's own Jinja template without adding everything from the base template.
-Tip: if you're just changing the CSS, you can start with the following
-boilerplate that I provide:
-
-```code
-{% extends 'base.html' %}
-{% block css%}
-//your cool css here
-{% endblock %}
-{% block content %}
-//your cool content here
-{% endblock %}
-```
-
-
### Making Secret Directories and Files
This program follows the Unix convention of placing a "." before directories
diff --git a/server.py b/server.py
index 15514ba..692fe8c 100644
--- a/server.py
+++ b/server.py
@@ -155,10 +155,10 @@ def send_file_from_site(path):
`render_file`, send the raw file to the user
"""
return send_from_directory('template/site/', path,
- mimetype=siteconfig.MIMETYPES.get(
- f".{ path.split('.')[-1] }", siteconfig.DEFAULT_MIMETYPE
- )
- )
+ mimetype=siteconfig.MIMETYPES.get(
+ f".{ path.split('.')[-1] }", siteconfig.DEFAULT_MIMETYPE
+ )
+ )
@app.route("/static/<path:path>")
@@ -168,10 +168,10 @@ def send_file_from_static(path):
`render_file`, send the raw file to the user
"""
return send_from_directory('static/', path,
- mimetype=siteconfig.MIMETYPES.get(
- f".{ path.split('.')[-1] }", siteconfig.DEFAULT_MIMETYPE
- )
- )
+ mimetype=siteconfig.MIMETYPES.get(
+ f".{ path.split('.')[-1] }", siteconfig.DEFAULT_MIMETYPE
+ )
+ )
def setup():