diff options
author | Caleb Jasik <calebjasik@jasik.xyz> | 2021-02-22 12:48:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 19:48:49 +0100 |
commit | 9791db1ce71801fb0da32d3d64cf93d700f64852 (patch) | |
tree | d847b7a7deac340f3dccf66e01c0c5e926746b41 /layouts/partials/docs | |
parent | 27c17911443b8d93c56b26664d62f8e5ec274288 (diff) |
Bug Fix: Empty .Site.Params.contentDir (#312)
* Bug Fix: Empty .Site.Params.contentDir
When .Site.Params.contentDir is left as the default: "content", calling .Site.Params.contentDir returns nothing, or maybe an empty string. To fix this, we set a default value for .Site.Params.contentDir to "content" and the url is built correctly.
* Use the `default` function instead of `or`
https://gohugo.io/functions/default/
Diffstat (limited to 'layouts/partials/docs')
-rw-r--r-- | layouts/partials/docs/footer.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/partials/docs/footer.html b/layouts/partials/docs/footer.html index e171077..f38e679 100644 --- a/layouts/partials/docs/footer.html +++ b/layouts/partials/docs/footer.html @@ -15,7 +15,7 @@ {{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} <div> - <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener"> + <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir | default "content" }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener"> <img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" /> <span>{{ i18n "Edit this page" }}</span> </a> |