Commit Graph

151 Commits

Author SHA1 Message Date
f911d8bd74
Add staging workspace and corresponding environment
Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 11:37:39 -05:00
7116e5e16f
Redirect naked domain to www when enable_naked_domain=false
Adds the variables:

- `enable_naked_domain`

  Whether or not to enable access to the site only via a naked domain.

  When `enable_naked_domain=true`:

  - This corresponds to the previous configuration.

  When `enable_naked_domain=false`:

  - Sets the domain_name to the www version of the domain and adds the naked domain as a
    SAN (Subject Alternative Name) on the ACM certificate
  - Create dns validation records for both the naked domain and www domain
  - Creates a s3 bucket with redirect policy which redirects all requests to the www version
    of the site
  - Creates a cloudfront web distribution with a custom origin of the website bucket
    url (this is required as s3 origins do not handle redirects)

- `subdomain`

  The subdomain to use under the `dns_apex`, eg `<subdomain>.<dns_apex>`. Defaults to empty.
  Remember, `dns_apex` must correspond to a route53 public hosted zone.

Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
2018-12-08 11:31:44 -05:00
30d39b002f Merge branch '1-migrate-to-terraform' of rekahsoft/blog-rekahsoft-ca into master 2018-07-15 20:22:19 +00:00
186d04041d
Site infrastructure and deployment now managed with terraform
Create a classic static site deployment using cloudfront with a s3 origin. Provision, verify and
utilize a ACM certificate to enable (and force) https for cloudfront.

This assumes that the build resources are available at ./_site as a null_resource is used to
sync it to the s3 origin backing cloudfront. A IAM user and policy is provisioned prior to the
null_resource execution with least privilege access to the s3 bucket.

Note: The required terraform backend resources were manually provisioned.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2018-07-15 03:01:18 -04:00
81064e68aa
Remove gitlab-ci.yml and discontinue use of gitlab pipelines
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2018-07-13 17:18:08 -04:00
a35aa7743b
Remove cloudformation deployment
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2018-07-13 17:17:06 -04:00
364762e223
Cosmetic spacing change in cabal file
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2018-07-13 17:01:09 -04:00
f8139b3718
Force reinstalls in docker-container build
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-11-04 22:49:57 -04:00
972ebc793e
Resolve dependency issues after package and ghc 8.2 upgrade
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-11-04 22:45:55 -04:00
1a26f68e09
Add published but uncommited Site updates post
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-11-04 22:28:01 -04:00
842837dbb3
Initial implementation of gitlab-ci pipeline
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-07-08 13:38:09 -04:00
975f6c42ee
Remove jsmin dependency from build process
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-04-23 22:19:19 -04:00
e91eba5dfb
Update deployment to use cloudfront and s3
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>
2017-04-23 21:45:27 -04:00
2e3e7c5906 Update to newer base
- Due to some issue with the firefox webdriver plugin, selenium tests are temporarily disabled
  for firefox

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2017-03-05 15:36:33 -05:00
de27657196 Fixed active nav item issue
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>
2016-02-08 19:39:10 -05:00
6979e8cbd4 Update copyright in LICENSE file and on home page
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-02-08 17:15:32 -05:00
cc65eb62c4 Fixed copyright year in footer
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-02-08 02:06:10 -05:00
bfb0b2830c Temporary cgit fix; missed a few lambda characters
Removed extra lambda from README.md. See the previous commit for details.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-01-17 05:38:21 -05:00
f026829d1c Complete refactor of js/default.js
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-01-17 05:30:04 -05:00
bb2dcbddf6 Update README.md
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-01-17 05:30:04 -05:00
32d3101989 Add piwik script in html instead of dynamically
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>
2016-01-17 05:30:04 -05:00
0d7faa8d8f Encapsulate analytics code using module pattern
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-01-17 05:30:04 -05:00
e7decd4349 Initial commit to branch upgrade-js
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>
2016-01-17 05:30:04 -05:00
c2aefc647f Remove unused class "loading-done"
The class "loading-done" is unused and should have been removed in
commit bc1cfaabeb.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2016-01-17 05:30:04 -05:00
84ccf775d7 Temporary change to README.md
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>
2016-01-17 05:30:04 -05:00
a37aedc45b Updated href used to find blog navigation item
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>
2015-08-16 03:10:40 -04:00
fda34f13e9 Removed TODO.org file used during refactor
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>
2015-08-16 03:10:40 -04:00
d16c970ae2 Removed unused "weight" context
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>
2015-08-16 03:10:40 -04:00
16a5e700cd Don't appcache posts, tag and blog pages (>2)
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>
2015-08-16 03:10:40 -04:00
339126bfc7 Moved tag pagination code out of function
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>
2015-08-16 03:10:40 -04:00
a879dded4b Fixed paginated tag links
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>
2015-08-16 03:10:00 -04:00
5719cc5dc9 Update site script and remove %site symbolic link
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>
2015-08-16 02:15:26 -04:00
98d564f061 Use absolute link to reference atom feed from nav
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>
2015-08-16 02:15:26 -04:00
af5ab576fb Updated site tests
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>
2015-08-16 02:15:26 -04:00
5e9ff21813 Fixed blog pagination link issue
See TODO.org for more details

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
b8b003f103 Removed unused image images/post-icon2.svg
"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>
2015-08-16 02:15:26 -04:00
a4b3d3d35e Moved pages/home.markdown to pages/index.markdown
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>
2015-08-16 02:15:26 -04:00
316ac7fd2d Consolidated repeat code for generating navContext
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
375dbcfc74 Fixed Tag pages pagination artifact
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>
2015-08-16 02:15:26 -04:00
deb81e9cbd Fixed double entry of /index.html in manifest
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>
2015-08-16 02:15:26 -04:00
53c782d5ab Cleanup spacing/formatting in src/site.hs
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
97d4bff5cd Site working with or without javascript
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>
2015-08-16 02:15:26 -04:00
c5803970bd Removed extra spacing from js/default.js
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
b065448a26 Removed jquery-address
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>
2015-08-16 02:15:26 -04:00
0902730137 Removed use of virtualpath contexts
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>
2015-08-16 02:15:26 -04:00
bc1cfaabeb Removed init and loading-error css and logic
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>
2015-08-16 02:15:26 -04:00
a21fe60c9e Fixed js page loading issue
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>
2015-08-16 02:15:26 -04:00
e5a90c220e Fixed blog paginate page links in manifest
Since paginated pages for the blog are now generated to "/", update
"/manifest.appcache" accordingly.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
baef1e6f00 Use double quotes instead of single quotes in html
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-08-16 02:15:26 -04:00
e634f0fbe4 Consolidated default and nojs versions of site
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>
2015-08-16 02:15:14 -04:00