diff --git a/build/scripts/tags.min.js b/build/scripts/tags.min.js
index cc2609f..bc43a90 100644
--- a/build/scripts/tags.min.js
+++ b/build/scripts/tags.min.js
@@ -79,7 +79,7 @@ this.on("mount",
});
-riot.tag2('post', '
No More Posts!
{opts.title}
By {opts.creator}
{content}
', '', '', function(opts) {
+riot.tag2('post', '
No More Posts!
{opts.title}
By {opts.creator}
{content}
', '', '', function(opts) {
var self = this;
this.loading = false;
diff --git a/build/templates/templates/index.html b/build/templates/templates/index.html
new file mode 100644
index 0000000..f37844c
--- /dev/null
+++ b/build/templates/templates/index.html
@@ -0,0 +1,42 @@
+{% block head %}
+
+
+{% endblock %}
+
+
+
+ {% block content %}
+
+
+
+
+
+
+
+ {% endblock %}
+
+
+
+{% block styles %}
+
+
+
+
+{% endblock %}
+
+{% block scripts %}
+
+
+
+
+
+
+{% endblock %}
+
+
+
diff --git a/build/website.py b/build/website.py
index 27c5c45..48f4007 100755
--- a/build/website.py
+++ b/build/website.py
@@ -4,8 +4,6 @@ from functools import partial
from flask import abort, Flask, render_template, flash, request, send_from_directory
from flask_appconfig import AppConfig
-from time import sleep
-
from urllib.parse import unquote
from urllib.parse import quote, unquote
from json import dumps, loads
@@ -56,15 +54,14 @@ def NeverWhere(configfile=None):
@app.route("/blog/switchpost/")
def switchPost(pid):
posts = {
- "1" : "Post one is changed! ",
- "2" : "Post two here and it's changed! "
+ "1" : "Post one is now changed as before! ",
+ "2" : "Post two here and it's changed again and again! "
}
return posts.get(pid, "false")
@app.route("/blog/comments/")
def comments(pid):
- sleep(5);
try:
return testcomments.get(int(pid), dumps([]))
except ValueError as e:
@@ -83,5 +80,5 @@ def NeverWhere(configfile=None):
app = NeverWhere()
-#if __name__ == "__main__":
- #NeverWhere("./appconfig").run(host="localhost", port=8001, debug=True)
+if __name__ == "__main__":
+ NeverWhere("./appconfig").run(host="localhost", port=8001, debug=True)
diff --git a/fabfile.py b/fabfile.py
index 429dfde..377b188 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -28,6 +28,13 @@ def buildVenv():
with prefix("source ~/build/venv/bin/activate"):
run("pip3 install -r requirements.txt")
+@task
+def buildLocalVenv():
+ with lcd("~/riotblog/build"):
+ local("virtualenv -p $(which python3) ~/riotblog/build/venv")
+ with prefix("source ~/riotblog/build/venv/bin/activate"):
+ local("pip3 install -r requirements.txt")
+
@task
def copyFiles():
local("cp ./{blog.ini,blog.service,requirements.txt} ./build/")
@@ -37,9 +44,8 @@ def copyFiles():
@task
def upload():
- run("rm -r ~/build")
run("mkdir -p ~/build")
- rsync_project(local_dir="./build/", remote_dir="~/build/", delete=True, exclude=[".git"])
+ rsync_project(local_dir="./build/", remote_dir="~/build/", delete=False, exclude=[".git"])
@task
def serveUp():
@@ -52,7 +58,6 @@ def serveUp():
@task(default=True)
def build():
- local("rm -r ./build")
local("mkdir -p build/{scripts,styles}")
buildTags()
buildScss()
@@ -61,3 +66,29 @@ def build():
upload()
buildVenv()
serveUp()
+
+@task
+def update():
+ local("mkdir -p build/{scripts,styles}")
+ buildTags()
+ buildScss()
+ minifyJS()
+ copyFiles()
+ upload()
+ serveUp()
+
+@task
+def locbuild():
+ local("mkdir -p build/{scripts,styles}")
+ buildTags()
+ buildScss()
+ minifyJS()
+ copyFiles()
+ local("sudo rm -fr /srv/http/riotblog")
+ local("sudo mkdir -p /srv/http/riotblog")
+ local("sudo cp -r ./build/* /srv/http/riotblog/")
+ local("sudo cp /home/wes/riotblog/blog.service /etc/systemd/system/blog.service")
+ local("sudo systemctl daemon-reload")
+ local("sudo systemctl enable blog.service")
+ local("sudo systemctl restart blog.service")
+ local("sudo systemctl restart nginx")
diff --git a/src/tags/post.tag b/src/tags/post.tag
index 2bbd036..269e7a5 100644
--- a/src/tags/post.tag
+++ b/src/tags/post.tag
@@ -1,7 +1,7 @@
-
-
+
+
diff --git a/src/website.py b/src/website.py
index 27c5c45..48f4007 100755
--- a/src/website.py
+++ b/src/website.py
@@ -4,8 +4,6 @@ from functools import partial
from flask import abort, Flask, render_template, flash, request, send_from_directory
from flask_appconfig import AppConfig
-from time import sleep
-
from urllib.parse import unquote
from urllib.parse import quote, unquote
from json import dumps, loads
@@ -56,15 +54,14 @@ def NeverWhere(configfile=None):
@app.route("/blog/switchpost/")
def switchPost(pid):
posts = {
- "1" : "Post one is changed! ",
- "2" : "Post two here and it's changed! "
+ "1" : "Post one is now changed as before! ",
+ "2" : "Post two here and it's changed again and again! "
}
return posts.get(pid, "false")
@app.route("/blog/comments/")
def comments(pid):
- sleep(5);
try:
return testcomments.get(int(pid), dumps([]))
except ValueError as e:
@@ -83,5 +80,5 @@ def NeverWhere(configfile=None):
app = NeverWhere()
-#if __name__ == "__main__":
- #NeverWhere("./appconfig").run(host="localhost", port=8001, debug=True)
+if __name__ == "__main__":
+ NeverWhere("./appconfig").run(host="localhost", port=8001, debug=True)