DEV Community

Discussion on: Which is the Best Static Site Generator and Why?

 
svitekpavel profile image
Pavel Svitek

+1. It reminds me of PHP -> too many special characters for no good reason.

Thread Thread
 
bayuangora profile image
Bayu Angora

Why you complicate your code with that code?

{{ $title := .Site.Title }}
<ul>
{{ range .Params.tags }}
    <li>
        <a href="/tags/{{ . | urlize }}">{{ . }}</a>
        - {{ $title }}
    </li>
{{ end }}
</ul>

What if make your code simpler like this?

<ul>
{{ range .Params.tags }}
    <li>
        <a href="/tags/{{ . | urlize }}">{{ . }}</a>
        - {{ .Site.Title }}
    </li>
{{ end }}
</ul>
Thread Thread
 
flrnd profile image
Florian Rand • Edited

I copy pasted it from hugo itself, ask the developer :).

Besides, that variable that you removed it's probably used in more parts of the code I copy-pasted.