Технічно технічний блог

Деякі експеременти, щось з програмування, щось із пізнання та дійсност

07 May 2022

Виправити деякі несправності в шаблоні свого ж блогу

published: May 7, 2022, updated: May 7, 2022; 08:08

Якось при написані блогу hugo serve -D видало таку помилку:

1
2
3
4
Start building sites …
hugo v0.94.2+extended linux/amd64 BuildDate=unknown
Error: Error building site: failed to render pages: render of "home" failed: "/home/user/jt0in3e.github.io/themes/ink-free/layouts/index.html:41:13": execute of template failed: template: index.html:41:13: executing "index.html" at <slicestr .RawContent 0 120>: error calling slicestr: slice bounds out of range
Built in 24 ms

Про схожі помилки пишуть тут і тут, наприклад, звідки й взято таке рішення (додано зміни до темлпейту теми):

vim themes/ink-free/layouts/index.html

1
2
3
4
5
6
7
8
9
<span class="description">
	{{ if isset .Params "description" }}
		{{ .Description }}
	{{ else if gt (len .Summary) 120 }}
		{{ slicestr .Summary 0 120 | markdownify }}...
	{{ else }}
		{{ .Summary | markdownify }}
	{{ end }}
</span>
Next time, we'll talk about "What Tiger King can teach us about x86 Assembly"