Creating a sitemap.xml file with Jekyll

Creating a sitemap.xml file with Jekyll

As the previous post on this site explained, I have switched this site to a static site generator. The site generator I chose is called Jekyll that can be extended using various add-ons; it also includes a powerful template generator called liquid.

The latest challenge I came across in this migration is creating a sitemap.xml file to allow search engines to discover all the pages on my site. There is a plugin, called Jekyll Sitemap, that can generate a sitemap; however, it doesn’t give me the customisation level required. My solution to creating a sitemap.xml file using Jekyll is to embrace the liquid templating system to make it for me!

Read more

Bloging using Jekyll, Azure Static Sites, cloudflare, and GitHub!

Bloging using Jekyll, Azure Static Sites, cloudflare, and GitHub!

It has been a while since I have written a post on melodiouscode.net; partly because it has been a busy year, but also because I didn’t fancy sorting out some server problems on my digital ocean droplet. Until now melodiouscode.net was hosted on the Ghost CMS Platform within an Ubuntu Droplet on digital ocean’s infrastructure; proxied through the Cloudflare platform for speed and security.

The image that the “Ghost Droplet” was created from contained an old version of the Lets Encrypt agent; the version of the Ghost install was out of date, and the theme I used didn’t support the new version of Ghost.

The Solution

After undertaking some research into alternative solutions, I decided to try out the Jekyll static site generator; why not go back to basics and have an HTML, Javascript, and CSS website?

Before I jump ahead I want to explain a little about what the components of my new Static MelodiousCode are; if you are just here for the instructions on how to host a Jekyll static site with Azure, Cloudflare, and GitHub skip down to the bottom!

Read more

Dependency Injection with Azure Functions

Dependency Injection with Azure Functions

I have been making good use of Azure Functions recently; their simple hosting style makes spinning up micro-services quick and easy whether they be HTTP, Blob, Table, or scheduled triggers. I have been making use of the schedule triggers recently to automate various processes for larger systems (they are substantially cheaper and easier to manage than Virtual Servers); to do so I have needed to make use of model/data layers within the rest of an application stack. Like most good code the other layers of these applications were designed to make use of IOC (Injection of Control) frameworks and DI (Dependency Injection; initially it seemed that IOC and DI were not possible with the Azure Functions platform. However, the addition of the support for Startup classes in Azure Functions v2 allows you to make use of the .NET Core Dependency Injection framework.

Read more

Visual Studio: Launch in Chrome Incognito

Visual Studio: Launch in Chrome Incognito

By default Visual Studio creates an entry for each recognised web browser you have installed when you first launch the IDE. We all know that we should be testing our web applications in more than just our favorite browser (after all, our end users may be using any number of browsers).

Visual Studio supports the addition of other browsers; and using this feature you can add other browser modes such as incognito. Why I hear you ask; incognito mode is not just for naughty browsing habits. It also containerised your cookies, and history; so if you are debugging an application that uses an external authentication provider you won’t inherit your existing sessions from other applications (my use case).

Read more