* templates/partials/analytics.html: Upon a client load of the website, determine which site
they are viewing (dev, staging, production) and setup plausible analytics appropriately.
* templates/default.html: Remove non-functional piwiki script reference and replace with a
reference to the new partial template for analytics
* src/site.hs (main): Remove remnant of application cache support
* js/default.js: Remove unneeded analytics code specific to piwiki. No additions were made here in support of plausible
* TODO.org: Mark associated TODO item DONE
Used TODO.org as a TODO list while doing a large refactor on the site.
Namely the nojs and default versions of the site were consolidated and
now any page can be viewed with or without javascript. This was done
using the HTML5 History API to change the URL without causing a page
refresh allowing SPA functionality after the first page load for those
who have javascript and normal functioning for those who don't. Also now
all links are unique (all links name a resource which is guaranteed to
exist). Before when the site used hash fragments there were multiple
ways to get to a page (E.g "/#/blog.html", "/#/blog1.html#/blog1.html",
"/#/pages/blog.html"). Besides being ugly, this can cause issues when a
link is shared. E.g if a users shared a virtual link like
"/#/posts/some-post.html" users with javascript would see the blog post
fine but those without would see the index page.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Though this commit is only a one character modification to src/site.hs,
its result is subtle. The identifier of each tag page must be routed to
the first page of its paginated pages, respectively. E.g the tag
"general" must have route "tags/general1.html" as to match up with the
actual output of paginating the tag pages.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Given a tag with name "gen", only "tags/gen1.html" through
"tags/genN.html" should be generated. Before this commit, an addition
file was unwittingly generated for each tag, which contained all posts
tagged with that tag (in the case of tag "gen" it would have generated "tags/gen.html"
which contains all posts tagged "gen").
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Now uses history.pushState as a replacement for jquery-address.
Links to blog and tag pages are broken currently; see TODO.org for
details.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Note: The sites javascript doesn't work currently as jquery-address has not
yet been replaced by the history api. This however doesn't stop users
from viewing the site, the javascript just errors out in the background
for users who have it enabled.
See TODO.org for more details of what needs to be completed
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Load html using $.parseHTML so that no scripts are executed, otherwise
all scripts are loaded each page load and ajax load which causes an
infinite loop.
Currently, though everything is functioning, there are a few
deficiencies. See TODO.org for more details.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Removed old nojs specific templates and updated "templates/default.html"
and "templates/partials/nav.html" to support nojs. All pages now use
relativized urls. Navigation pages (including blog paginated pages) are
generated to "/" instead of "/pages/".
Site now works when javascript is disabled. Unfortunately, it no longer
works when javascript is enabled. This is due to the client side router
but needs to be debugged further.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>