Bootstrap the environment using:
./site init-env <stack-name> <cf-bucket> <cnames>
- stack-name :: is the stack name used for the infrastructure bootstrap cloudformation template
- cf-bucket :: is the name of the S3 bucket that holds the cloudformation stack that will bootstrap
the environment
- cnames :: is a comma separated list of domains to be used as CNames with this deployment
Note: this can also be run directly with ./init-env.sh
Once the environment has been bootstraped, the site can be deployed using the variables given
in its output.
AWS_DEFAULT_REGION=<region> \
AWS_ACCESS_KEY_ID=<access-key> \
AWS_SECRET_ACCESS_KEY=<secret-key> \
S3_BUCKET=<s3-bucket> \
./site deploy
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 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>
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>
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>
The type of the function `readPandocWith` changed slightly between
versions. This commit fixes the minor issue it caused.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
Now when './site deploy' is run the empty files that are left over from
Hakyll generating the site are removed. Also rsync now uses verbose
output so that its easy to see what files are updated on the server.
Note, because the commands run by './site deploy' include 'echo' and
'find' this requires a posix environment (and thus can't be built on
Windows without cygwin).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
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>