diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-16 08:23:25 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-04-16 11:53:36 +0200 |
commit | 5affd26bfb4e692ffe468f411fb83deb64dd6495 (patch) | |
tree | 2a93d3df13734f7bde1bda7fdc1e9f36f6974785 /layouts/partials/docs/shared.html | |
parent | 4054b1b520ae53328027ca477e1a9abc1733a11a (diff) |
Adjust .File usage to get rid of WARNINGs
Note that this requires this fix in Hugo 0.55.2:
https://github.com/gohugoio/hugo/issues/5865
Diffstat (limited to 'layouts/partials/docs/shared.html')
-rw-r--r-- | layouts/partials/docs/shared.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/docs/shared.html b/layouts/partials/docs/shared.html index ec303f5..3fbf628 100644 --- a/layouts/partials/docs/shared.html +++ b/layouts/partials/docs/shared.html @@ -1,10 +1,10 @@ {{/*These templates contains some more complex logic and shared between partials*/}} {{- define "title" -}} - {{- if .Pages -}} - {{ $sections := split (trim .Dir "/") "/" }} + {{- if and .File .Pages -}} + {{ $sections := split (trim .File.Dir "/") "/" }} {{ $title := index ($sections | last 1) 0 | humanize | title }} {{- default $title .Title -}} - {{- else -}} + {{- else if .File -}} {{ $title := .File | humanize | title }} {{- default $title .Title -}} {{- end -}} |