How to name list templates?

This works and it is acceptable solution for now (of course, it would be great if it would work automatically in some manner)

My titles.toml:

[Programsko-Rjesenjes]
title = "Programska rješenja"
description = "Naša programska rješenja kreirana za vaše potrebe"

Here is the code in list.html

{{ .Scratch.Add "title" "" }}
{{ .Scratch.Add "description" "" }}

{{ if isset .Site.Data.titles .Title }} 
    {{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }} 
    {{ .Scratch.Set "description" (index .Site.Data.titles .Title).description }} 
{{ else }} 
    {{ .Scratch.Set "title" .Title}} 
    {{ .Scratch.Set "description" .Description}} 
{{end}}

And it is used in HTML like this:

<h2 class="page-header-title" data-ix="page-title">{{ .Scratch.Get "title" }}</h2>
<h2 class="page-header-title description" data-ix="page-title-2">{{ .Scratch.Get "description" }}</h2>

Thanks for suggestion.

2 Likes