Removed all haml templates and returned to using the default hakyll
style html templates. The main reason for this was to avoid the
requirement for external tools that cannot be installed with cabal. Also
as much as haml is nicer to read and write (in my opinion) it is in this
case just adding another layer of needless abstraction.
Perhaps in the future haml-like functionality can be added to default
hakyll templates. Until then, follow the KISS mentality.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
I was thinking of using hamlet for templates but hadn't implemented
anything yet. Using hamlet doesn't work well in this case though because
hamlet templates are compiled (using template haskell). Removed this
false mention from README.md.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Only two ghc warnings remain; that is:
* defaulting a type to integer (line 476)
* discarding the result of a do-notation statement (can be turned off
with the -fno-warn-unused-do-bind option (line 502)
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Added the --verbose=0 option when "cabal run gencss compact" is run from
src/site.hs. This stops cabal from outputting compiler/success messages
to the front of the generated css file.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Removed dependency on sass in src/site.hs and replaced it with clay.
This is achieved by adding a second executable to the projects cabal
file (called 'gencss') and a folder (called 'clay) that contains all .hs files for
clay (nested however deeply). Then whenever the site is being built, the
"cabal build gencss" command is run, which if successful is followed by
"cabal run gencss compact" whose output is captured and saved to
/default.css.
The sass folder has been left while the majority of the sass has not
been ported over to clay. Only part of sass/default.sass has been ported.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Cleans up error reporting when an ajax call fails, and thus
the #page-content div can't be filled. This is accomplished by using
a #status which has a p.message element that can be populated for text
displaying status messages. By adding either .error or .success
to #status causes it to be highlighted as either a error or success message
respectively.
When its the first load of the page, and #page-content hasn't yet been
populated with content, an error message is shown in the #page-content
div.
Removed the /posts/ and /tags/ fallbacks in the generated
manifest.appcache because even when online, ajax calls for invalid URLs
under those paths return the respective fallback page instead of an
error message, and populate the #page-content div with the fallback. So
from this point forward the fact that the website is offline will be
handled from JavaScript.
When a page is not accessible in the application cache and the user is
offline, an error message is displayed using the mechanism mentioned
above.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Instead use a single pattern (providing the route also remains
unchanged; that is, idRoute)
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Paginate tag pages, allowing maximum 2 pages per tag to be app cached.
Setup virtual paths for tag pages such that /tags/tagname.html loads
/tags/tagname1.html similar to how pages are handed. This is similar to
how pages are handled in that /pagename.html loads /pages/pagename.html.
Dry up blog page's pagination and create a dry template for pagination
because it is also used on the tag pages.
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
This causes a bug when using the android browser. Specifically, because
pages/blog.html is appcached it always prefers the appcached version and
thus loads an empty blog (unless you explicit request pages/blog1.html)
This empty file is required while generating the navigation. There seems
to be no way to not write a file once within the Rules monad (or at
least it's not simple).
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
Paginate URLs now working correctly. In posts and pages a link to a page can be given
using either:
- absolute url (eg. /pages/somepage.html)
- virtual page path (eg. /#/somepage.html)
This is achieved in js/default.js by treating a tags with the rel
attribute as virtual. Specifically, the rel attribute should be of the
form "address:/virtual/path.html" , though this isn't tested for. If a
value val, is found in the rel attribute then it is used as the URL in
loadPageContent where if it doesn't match certain regexps it is assumed
to be a page and "pages" + val is loaded into the page-content div. See
loadPageContent for more details.
Placed first page, previous page, next page, and last page links at
bottom of blog pages to switch between pages.
Still incomplete:
- pagination menu needs to be further styled with images, tool tips, etc.
- check if rel conforms to the form /address:.*/ and if not don't treat
is specially (as virtual)
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
- pagination of posts now works (they are output to pages/blog<n>.html
where <n> is a number from 1 to some natural x)
- pages in pages/* are weighted 1 to some natural y for the purposes of
generating the menu; but now items that are weighted 0 will not show
up in the menu and instead will be hidden. This allows for the
paginated pages to be generated to _site/pages/blog<n>.html as above
but also avoids showing them in the generated menu.
Now there still is the issue of showing the pages. js/default.js has
been slightly modified to allow the new format of the paginated blog
pages along with the original blog page.
Things yet to complete for pagination:
- the original blog page still needs to be removed as it will be
replaced by the paginated pages
- need to modify templates/partials/post-teaser-list.haml to show the
forward/backward buttons from the paginate context.
- paginate tag pages
- find a clean way for the paginated pages (blgo and tags) can be
viewed/selected
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>