Jul 12, 2017

How I switched from Jekyll to Hugo

When I first decided that I’ll build my website using some static generator, I was totally impresed with Jekyll. But after some time the template I was using got depreceted and I didn’t have any time to update it.

Then few days ago the awesome PHP framework Nette announced that they’ll use Hugo for one of their websites. I took that as an opportunity to rewrite my own website (with own styles too), add https and learn some new system (albeit not so different from Jekyll). Plus if it’s good enough for Nette, it should be good enough for me also…

I’ll try to write more posts about Hugo in the following days, including configuration for GitLab CI, gulp with sass or how to add https to your own websites for free.

Until then, check out the repository for my new blog :-)

Jul 21, 2015

How to use AngularJS in Latte templates

In default Latte uses “single” curly braces for its macros:


and Angular “double” curly braces like this:


Unfortunately this will throw an error at Latte because everything right after first opening curly brace is considered to be a Latte macro. Of course, there isn’t any macro named {user.name}.

Luckily the solution is pretty simple. The only thing you need to keep in mind, is to put a space after opening curly braces. There is no need to change Latte syntax.

{{ user.name }}

This is how your Latte template can look like with Angular:

<div n:if="$user->hasTasks()" ng-controller="TasksController as tasks">
	<strong>{$user->getName()}: </strong> {{ "{{ tasks.items.length " }}}} tasks