Site doesn't generate with ordering by title
bobsaintcool opened this issue · comments
Hi!
Experimenting docdock Hugo's theme with the following settings where I encounter some error while generating the website.
baseURL: https://boom
title: wiki
baseURL: /
languageCode: en-us
DefaultContentLanguage: en
defaultContentLanguageInSubdir: false
enableMissingTranslationPlaceholders: false
theme: docdock
smartDashes: false
pygmentsCodeFences: true
pygmentsStyle: monokailight
params:
showVisitedLinks: true
themeStyle: flex
ordersectionsby: title
disableHomeIcon: false
disableSearch: true
disableNavChevron: true
highlightClientSide: false
menushortcutsnewtab: false
enableGitInfo: false
outups:
home:
- HTML
With that, running/generating the website lead to a lot of errors like the following:
ERROR 2018/05/27 10:59:04 Error while rendering "section" in "": template: wiki/themes/docdock/layouts/_default/list.html:13:9: executing "wiki/themes/docdock/layouts/_default/list.html" at <partial (printf "%s/...>: e
rror calling partial: template: theme/partials/flex/body-beforecontent.html:43:12: executing "theme/partials/flex/body-beforecontent.html" at <partial "flex/select...>: error calling partial: template: wiki/themes/docdock/layouts/partials/flex/se
lectnavigation.html:54:10: executing "menu-nav" at <after 1 (seq $level)>: error calling after: no items left
Not knowing lot on both Hugo and Go, I've dig a bit and the problematical configuration seems to be the following ordersectionsby: title
where the buggy line:
{{- range after 1 (seq $level)}}-{{ end }} {{.Title}}</option>
By trying to protect the slice split like the following, the site generate as I expect:
53,54c53,56
< <option value="{{ .RelPermalink}}" {{if eq .URL $currentNode.URL}} selected{{end}}>
< {{- range after 1 (seq $level)}}-{{ end }} {{.Title}}</option>
---
> <option value="{{ .RelPermalink}}" {{if eq .URL $currentNode.URL}} selected{{end}}>
> {{if gt $level 1 }}
> {{- range after 1 (seq $level)}}-{{ end }}
> {{end}} {{.Title}}</option>
But I'm not sure I'm solving the problem the right way.
Any insights?
Thanks
Hi @bobsaintcool,
Is this still actual?
@Pilskalns I cannot reproduce the bug anymore, don't known what happen but seems good to me now?
I don't know the context for the error above, but it might be that just a Hugo restart solved it.
Thanks for the swift response, closing.