govuk-one-login / service-header

A header for services using GOV.UK One Login
https://govuk-one-login.github.io/service-header/
6 stars 4 forks source link

BAU: Fix deploy to GH Pages action #18

Closed danacotoran closed 1 year ago

danacotoran commented 1 year ago

The deploy to Github pages action is failing after adding the documentation on installing the header with the Prototype Kit.

This is because GH pages uses Jekyll to convert MD into HTML, which uses Liquid as a templating language, which has a very similar syntax to Nunjucks. The {% %} tags used to exemplify usage of the header in prototype-kit-installation.md are picked up as Liquid code, causing errors in the deploy to pages action as Liquid does not have the same syntax as Nunjucks so certain keywords such as set are not recognised.

This is a workaround which uses Liquid's {% raw %}...{% endraw %} tags to escape the Nunjucks/Liquid syntax in the documentation file which should eliminate the build errors. https://stackoverflow.com/questions/3426182/how-to-escape-liquid-template-tags