* .gitignore: Ignore lib/MathJax symlink.
* README.org: Variety of changes, most notably using the README.org file as a literate source
file, which generates various development scripts and a Makefile. One such script is the
vendoring script, which is used to setup vendor symlinks.
* bootstrap.sh: Run emacs to tangle the literate README.org file, after which, run setup
vendored dependency links.
* guix.scm: Depend on js-mathjax, and vendor its built files into lib/MathJax before building
the site.
* pages/index.markdown: Remove stale reference to jquery-address.
* src/site.hs: Adjust hakyll rules to include MathJax from its now locally vendored location.
Additionally, do a tiny bit of rule tidying.
* templates/default.html: Remove stale reference to appcache. Remove reference to MathJax via
cdn and reference the now vendored variant.
* src/site.hs (siteRules): Refactor site building Rules into a new variable allowing for
reuse. Remove duplicate rules ()
(myConfig): Set deployCommand to something temporary.
(_devWatch): Entrypoint mean for use in development; it rebuilds the site builder, then
rebuilds the site.
* site (Removed file): Removed as it is no longer necessary. If additional cli functionality
is required, this can be done directly in haskell.
* guix.scm: Symlink 'site' now that it is no longer provided as a script.
(setenv): setenv only applies to the first (non-cached) run of `guix shell ...`,
because of this, remove setting PS1.
(native-inputs): Include development environment dependencies
* channels.scm (channel): Update rekahsoft-guix channel (noop, but originally updated while
looking at using overmind).
* bootstrap.sh: A script that generates various development scripts from the projects
README.org file.
* README.org: Cleanup and minor restructuring.
(Repository Structure): New (incomplete) section
(Prerequisites): New section
(Quick Start): New section
(Hakyll Site Commands): New section, with subheadings for various hakyll sub-commands.
(Makefile): New section; generates a makefile useful for development
* .gitignore: Ignore files generated by ./bootstrap.sh
* .ghci: ghci configuration file for hakyll development.
* .envrc: direnv configuration that loads a development environment for those who have
allowed it
* 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
The compressCssCompiler has been used for javascript for a long time for this website.
Despite this not being a wise decision, it worked up until some version of Hakyll. I should
minify the javascript as part of the site building process, but for now will simply copy the
javascript files as is.
This primarily includes updating dependencies, and using stack for sane dependency management.
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
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>