Commit Graph

151 Commits

Author SHA1 Message Date
b0851fc6fa Fixed li bullet indicator
Use the unicode arrow '2192' infront of ol > li bullets. This must have
been missed while porting css from sass to clay.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-23 14:26:20 -05:00
2401f3aa9b Trivial UI cleanup on individual posts
Both the clay css and templates/partials/post.html added a horizontal
rule at the top of each post footer (using the css border property and
hr respectively). Opted for using the clay css one as its used on
multiple pages (eg. blog pages and tag pages).

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-22 13:40:52 -05:00
3df2f3df34 Cleaned up client side URL rewriting
When a page listed in the navigation was opened in a new page/tab, the
url used to be the whole path (/#/pages/pagename.html). This commit
enables rewriting of the urls (using jquery address) so that the client
always sees a pretty url (eg /#/blog.html instead of
/#/pages/blog.html).

Also fixed issue introduced last commit (b6d6830) where when clicking on
post or tag links failed to activate the blog menuitem.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-22 13:35:58 -05:00
b6d683014d Fixed opening nav items in new tab/window
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-22 01:07:48 -05:00
e2fd291e8f Fixed opening issue with links within page-content
Previously, all anchor clicks within #page-content was handled by a
event listener that checked whether the anchor's href was to an
'external' url and if so loaded it directly. Otherwise it passed the
value of the anchors href attribute to the jquery address plugin (via
the $.address.value function).

This unfortunately cause clicking on anchors to work fine but when
opening them in a new page or window (or copying the link) caused the
link to reference the html snippet of the page/post instead of the
entire application.

To rectify this, this commit simply transforms internal urls href
attribute after the snippet is loaded into #page-content.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-22 00:24:52 -05:00
046f97a2bb Passes most jslint tests
Excluding insecure regexps (used to check urls - which is not a security
risk in this case). In a future commit this can be fixed by adding
comments ignoring the jslint errors or by making the regexps more
specific.

Also in the ajax call in loadPageContent the callbacks fore beforeSend
and error have unused parameters (xhr and settings, though the error
callback uses its second argument status).

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-19 23:53:38 -05:00
86b05d8f28 Fixed rendering of source code
Commit cd5ae7b652 (the switch to clay)
introduced a error rendering source code in posts.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-19 23:40:37 -05:00
723fde5fee Fixed creative commons license link on home page
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-19 23:40:03 -05:00
4fa0eed737 Cleaned up README build instructions
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
d5f2f56ec4 Completed porting haml templates back to html
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>
2015-01-14 04:50:29 -05:00
0213eec3af Modified pagination template
Switched from four .four.column divs (one for firstPage, previousPage,
nextPage, and lastPage) to two .eight.column divs (one for firstPage and
previousPage, and the other for nextPage and lastPage).

This is mostly an ascetic fix that will be modified in the future when I
get around to theming the pagination buttons.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
08cb941a93 Removed unused/stale template
The template "templates/recent-posts.haml" has been superseded by
"templates/partials/recent-post-list.haml" but was left behind.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
4b8c5a8c04 Fixed some comments and a false mention in the README
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>
2015-01-14 04:50:29 -05:00
23ad19ffa6 Cleaned up src/site.hs fixing most ghc warnings
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>
2015-01-14 04:50:29 -05:00
662309ff4e Fixed link in business-card snippet
Now when using "./site check" everything looks good (excluding the
reference to nojs/index.html from templates/default.haml)

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
038657caf4 Updated utilized open-source software list on homepage
* removed references to sass and bourbon
* added reference for clay

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
9a9630435b Fixed handling of internal image urls within page-content
When an anchor within #page-content has a href matching /images\/.*/ it
should be viewed as a resource for download/view instead of loaded into
$page-content.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
4c2f99c302 Added README.md
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
72e6291915 Removed sass css implementation in favor of clay
Now that the css (implemented using sass) has been fully ported to clay,
the sass folder can and has been completely removed.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
cd5ae7b652 Finished porting css from sass to clay
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
81c675f7b4 Fixed clay css output issue
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>
2015-01-14 04:50:29 -05:00
7b08488815 Ported sass/_blog.sass to clay and modularized clay css files
* ported sass/_blog.sass to within clay/Header.hs (excluding use of
mixins - see comments in source)
* split up clay css into a few modules (Util, Header and Main)
* still missing any properties that were implemented as sass
  mixins (from sass/default.sass and sass/_blog.sass) as well as porting
  the following sass files (from sass/):
  * _home-page.sass
  * _contact-page.sass
  * _post-page.sass
  * _tag-page.sass
  * _src-highlight.sass

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
c64af63d82 Switch from sass to clay for css pre-processing
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>
2015-01-14 04:50:29 -05:00
b6b60871bd Added symbolic link for easy execution of site generator
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
06b4752bee Fixed a couple comments in site javascript
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
5bbacb1725 Added initial implementation of error messages
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>
2015-01-14 04:50:29 -05:00
f0a702f5d4 Reduced repetition of arguments passed to transform
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
7b9530089d Added justification of posts' paragraphs
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
5c219069c4 Added site-wide rss link icon
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
3d49ef6194 Fixed use of 'i' instead of 'I' in first blog post
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
0bf8f8a6a1 Remove repeated copyFileCompiler Rules
Instead use a single pattern (providing the route also remains
unchanged; that is, idRoute)

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
a746af2a02 Fixed link to git repository on home page
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
891fadf3a2 Paginate tag pages
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>
2015-01-14 04:50:28 -05:00
5a23b9c90a Fix whitespace in src/site.hs
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
eaf84dc375 Use dried up template for displaying posts on tag page
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
c1c82e397f Don't appcache empty file pages/blog.html
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>
2015-01-14 04:50:28 -05:00
496e0d5396 Bump to Hakyll 4.6 and clean up
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
db3bddea81 Remove unused fonts
This saves more then 10MB space which reduces the application cache to < ~3MB

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
001d4c05f0 Finished up pagination and cleanup
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>
2015-01-14 04:50:28 -05:00
a0aed31d54 Pagination working but still needs to be cleaned up
- 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>
2015-01-14 04:50:28 -05:00
696fcd2759 Corrected license file and updated cabal file
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
db32e6d156 MathJax CDN URL changed
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
719e0753ca Compile src/site.hs with -Wall and -02
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
7e33aa7fe5 Initial cabalization of site
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
ed278bb117 Various minor aesthetic fixes
- made the border surrounding content a consistent width on each page
- minor aesthetic changes to the tag page
- removed need for index.html

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
4dc9224af3 Removed submodules
Was having issues with submodules filling two directories at the same
time (lib and lib-src; hard links maybe the cause?). Anyways for the
time being removed them.

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2014-03-13 04:47:59 -04:00
dc814507cc Further various fixes and improvements
- fixed path of gitsubmodules
- added folder 'files' for files that are not to be App Cached
  and included my public gpg key
- did a little work on the business card (displayed on the home page and
  contact page
- changed app cache fallback pages to be in haml instead of html

js/default.js:
  - added support for mailto and download-able (not app cached) links
  - added support for mathjax (called on each call of 'loadPageContent')

site.hs:
  - added support for using arbitrary pandoc reader/writer extensions
  - added support for rendering of maths (using mathjax)
  - added generation of tag pages to the application cache (a fallback
    is still used for the rss feeds as they are not necessary while
    offline)

TODO:
  - pagination (n posts per page)
  - save n most recent posts to localstorage and support option to
    add/remove posts
  - add general fallback page to handle main rss feed and other files
  - content and styling

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2014-03-12 20:59:58 -04:00
3a7e6b5e4a Variety of changes; see log for more details
Almost ready for prime time. What remains to be completed is as follows:
 * pagination
 * fix the escape parsing bug in the section parser
 * add support to locally cache posts (opt-in)
 * clean-up the code
 * finish contact page and home page

The following was completed since last commit:
 * added gpl.txt to project
 * deleted otf free fonts to save space
 * various structural changes
 * added a new post 'first-post'
 * various ascetic changes to templates and sass code
 * used function to remove js from global namespace (js/default.js)
 * added support for application cache and generating a cache manifest
 file (site.hs) as well as created appropriate fallback .html
 files '{post,tags}-fallback.html'

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2014-03-05 18:20:03 -05:00
512e89f565 Major changes! See full log.
* Changes

** Hakyll "site.hs"
*** Added the ability to have per-page templates (for all "pages/*")
*** "pages/*" can now be sectioned off into blocks
    A section is a logical division of a page. It removes the requirement
    for pages that have multiple sections to have some html in the
    markdown for the page or to move some of the markdown content to the
    template. Both of which are un-maintainable.

    There are two types of sections, both with slightly different syntax's.

    A _global section_ is a section who's content will be included in all
    sections (regardless of ordering). This is handy for including links
    and footnotes that might be needed in more then one section or
    non-section . It is not accessible from the Context obtained from
    genSectionContext. To indicate where a global section begins and ends
    use "$section$" and "$endsection$" respectively (without
    quotes). Formally:
                       $section$ <body> $endsection$

    A _named section_ is a section of a document that can be accessed by a
    given name from the context obtained from the function
    genSectionContext. To specify a named section use the following syntax:
                  $section("<name>")$ <body> $endsection$
    where <name> is the name of the section (any character except \")
      and <body> is the section body

    Anything that is not a section is referred to as a non-section. These
    are still important as they will include all
    content of the global sections of the document as well as the
    non-section itself. To be a little more formal a non-section is
    everything between "$end-section$" and ("$section$ or
    $section("<name>")$").
**** Example: mypage.markdown
     page title
     ==========
     $section("column-one")$
     This is text that can be formatted in the individual page template
     located at "templates/pages/mypage.haml". Here is a link from a
     global section. See [Home][].
     $endsection$
     This is some text in between two sections or a section and the top or
     bottom of the page. It can be accessed by $body<n>$ where <n> its
     position from the top of all non-sections starting from 0. Here i can
     also use
     $section$
     [Home]: http://blog.rekahsoft.ca
     $endsection$
***** To see more visit
       - "pages/<name>" where the sectioned page markdown is written
       - "templates/pages/<name>.haml" where the individual page
         template is stored/loaded from
       - "templates/page.haml" the generic page wrapper

** Miscellaneous
*** Reorganized the file structure
     - created folder "image-src" for image-sources
     - created folder "lib" for libraries that will be needed on the server
     - moved jQuery and Skeleton to lib and made appropriate
     - created folder "fonts" for FreeMono and FreeSans font files which are
       now used via css @font-face
     - create folder "css" and setup "site.hs" to minimize all css files
       and publish them to idRoute
     - created folder "sass" which contains a variety of s[ac]ss files along
       with a file named "default.s[ax]ss" which will be processed by sass
       to include any other s[ac]ss files that are needed and output
       "default.css" to the site root
*** cleaned up .gitmodules

** Javascript
   - fixed processing of urls
   - temporarily disabled nojs version of site as its under heavy development
     Note: still need to merge changes made to default version into the
     nojs one; specifically having "templates/pages/*.haml" be applied to
     there respective page before "templates/page.haml" is applied to the
     result

** Styling
   - switched to using sass (with a side bourbon) instead of css
     leaving css folder and processing for convenience
   - slimmed the site of the nav-loading image
   - updated favicon (rounded corders, preparing to support more sizes)
   - updated the logo-banner
   - added new images for tab page

** Templates
   - converted all "templates/**" to haml and made the apropriate
     adjustments in site.hs
   - added "templates/pages/*" which contains individual templates per
     page in "pages/*"

** Known Issues
**** Sections cannot contain $section$ or $section("<name>")$ or $sectionend$ in them (this is an issue with escaping in the parser)
**** pagination has been attempted but no solution yet
**** haven't been able to generate two sets of tag-pages (one for the default version and the other for the nojs version
**** opening a internal link in a new tab in any browser will load the snippet that would normally loaded by by ajax

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2013-12-10 23:31:48 -05:00
de5b144286 NoJs version now generates a index.html page
No longer is nojs/pages/* generated. Instead pages are generated to nojs/pageName; where
pageName is the name of the page (with extension changed to html) with the exception that if
the page is named "home.markdown" it will be generated as index.html in the nojs folder.

Fixed links in templates accordingly.
2013-11-04 01:13:28 -05:00