slideshare quotation-marks triangle book file-text2 file-picture file-music file-play file-video location calendar search wrench cogs stats-dots hammer2 menu download2 question cross enter google-plus facebook instagram twitter medium linkedin drupal GitHub quotes-close
Momument valley

I've been working on extracting our Code Enigma theme from our site so that it can be composer installable. The benefits of doing this are:

  • we can open-source our theme
  • we can use our theme across our different platforms
  • we avoid copy/paste copies of our theme (and the maintenance overhead that comes with that)

We have been using Pattern Lab but we're wanting to remove it so one of the first steps I took was to copy the pattern lab templates into our Drupal theme (they're essentially Twig templates, so that was straightforward).

Next, I had to replace all of the includes and embed tags that included templates from Pattern Lab, so

{% include "@basics/images/logo/logo.twig" %}

would need to be changed to

{% include "@ce/includes/logo.html.twig" %}

Thankfully, the following regex turned up all the tags I'd need to change:

[embed|include](\s)*['|"]{1}@

And once I'd got going, adding a negative lookahead to the regex filtered out those occurrences I had already fixed

[embed|include](\s)*['|"]{1}@(?!ce)

There's still much to do, but I'll post a link to our Github repository when we push it up.

In other news, I completed Monument Valley by Ustwo games.

More from the developer cabin