The navigation was working correctly before the javascript refactor, and
seemed to be working correctly after as well, except when clicking on
links to tag pages or posts from within #page-content. When an internal
link to a post or tag page is clicked the navigation should set the
"blog" menuitem to be active. Unfortunately, this was not the case
before this commit but luckily this commit rectifies this.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Instead of adding the piwik javascript dynamically in javascript, add it
using a script tag in "templates/default.html".
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Start incrementally adding to sites javascript. Starting with, handling
application cache events, then considering additional features like
using local storage to allow offline reading of posts, as well as an
interface to view and manage them.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Due to a upgrade of cgit and python-markdown on rekahsoft.ca, special
characters (like lambda) seem not to be displayed properly in about
pages when passed though cgits' markdown to html script. Once the issue
on the server has been resolved the original lambda special character
will replace the 'Lambda' temporary placeholder.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Due to pagination, the first page of the blog is routed to "/blog1.html"
and this href is used in the navigation as well. Thus to set the blog
navigation menuitem to active, the href needed to be updated.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
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>
The constField "weight" is no longer needed to be set to zero when
generating blog pages because the paginated pages are no longer captured
when generating the navigation (context).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Add context for appcache that can be detected in templates, which is
used to avoid appcaching post pages, as well as used to appcache only
the first two pages of the blog and for each tag.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Refactor tag pagination function paginateTagsRules into main as it is
only ever needed/used once.
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>
Refactored and cleaned up site build script. Use cabal to run executable
instead of through the link %site. Added options for running
cabal commands clean, configure, and build via options clear, configure,
and make respectively. These different names were used as to not reuse
ones already in use by the hakyll generated site binary.
Update deploy code in src/site.hs as there is no need to remove empty
files anymore as they are no longer generated.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This is required otherwise links to the atom feed on any post or tag
page will be broken.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Due to pages being generated to "/" instead of "pages/" some minor
changes were required. Also some repeated code related to filtering and
looking up html files was relocated to a function and improved.
These tests still are not very comprehensive and there's definite room
for improvement. One issue is when the tests are run they generate
needless/useless analytics data.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
"images/post-icon2.svg" is an exact copy of "images/post-icon.svg" and
thus can be removed.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This removes a special case when generating the pages. Namely having to
change the route of "pages/home.markdown" to "pages/index.markdown"
before being converted to its final route of "/index.html".
Note: Because "pages/home.markdown" was renamed, its template
"templates/pages/home.html" has also been renamed to
"templates/pages/index.html".
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>
Because index.html is now generated as part of the "pages/*" rule (via
"pages/home.html") and there is no shell index page which then is filled
with content using javascript, "index.html" does not need to be listed
explicitly for manifest.appcache generation.
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>
Now because all URLs are now valid urls, and no special treatment of
pages is required the following changes were made:
* Removed rel attribute from navigation anchor tags in
"templates/partials/nav.html"
* Removed use of virtualpath context and associated pagination code
associated with virtual paths in "src/site.hs"
* Removed unneeded bloat from "templates/paritals/paginate.html" because
irtualPaginateContext is now no longer needed
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Because all pages are complete pages that can be viewed with or without
javascript, the 'init' and 'loading-error' classes should not be set on
the '#page-content' div. Similarly the 'loading' class should not be set
on '#nav'. All associated logic and css for the 'init' and 'loading'
classes is also unused. This commit removes the aforementioned.
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>
Since paginated pages for the blog are now generated to "/", update
"/manifest.appcache" accordingly.
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>
Because the metadata of pages/* is needed for generating pages/* itself,
and for posts/**, it must be preprocessed. This is done in the version
"nav-gen" but because the pages are not given a route, they have an
empty $url$ field within templates. That is, when a list of pages is
retrieved and used to generate the navigation, they have no url field,
thus breaking navigation. Specifying the same route for both solves this
problem, as the final version depends on the preprocessed version and
thus will be the final result.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Unfortunately, tags do not seem to be working correctly. That is:
* Nothing seems to be generated to the expect spot
_site/nojs/tags/*.html
* tagcloud for tagsNoJs is empty
* tags are displayed on post pages but are not hyperlinked
Currently why this does not work is unknown.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Updated nojs site as the code became stale over time as a comment. Nojs
site now mostly works, excluding the following issues:
* Navigation links have no href.
* Tags do not seem to work; the tagcloud that is displayed on the nojs
homepage references the tags for the main site and tags aren't
displayed in posts. The cause for this is not yet known.
* Unused templates that are nojs specific can be removed:
* templates/archive.html
* templates/partials/post-nojs.html
* templates/partials/recent-posts-nojs.html
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Also updated the name of template files from *.haml to *.html as haml is
no longer used for html templates.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Setup Piwik tracking of page loads. The global array _paq is used to
communicate commands to the piwik tracker via the script piwik.js which
is loaded asynchronously from the analytics server. Every time a ajax
call is made successfully and content is loaded in the page, analytics
data is captured and sent to the tracker (the loadPageContent function).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Allow all robots to access any part of the site. This may change in the
future, as the html snippets that are generated for the posts and pages
should not be directly indexed.
See: http://www.robotstxt.org/robotstxt.html
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>