diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | layouts/partials/docs/git-footer.html | 4 | ||||
-rw-r--r-- | layouts/partials/docs/shared.html | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c7975d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +public/ +exampleSite/public/
\ No newline at end of file diff --git a/layouts/partials/docs/git-footer.html b/layouts/partials/docs/git-footer.html index 4a856d3..4b2f44d 100644 --- a/layouts/partials/docs/git-footer.html +++ b/layouts/partials/docs/git-footer.html @@ -10,9 +10,9 @@ {{ end }} {{ with .Site.Params.BookEditPath }} <div> - <a href="{{ $.Site.Params.BookRepo }}/{{ . }}/{{ $.File.Path }}" target="_blank" rel="noopener"> + {{ if $.File }}<a href="{{ $.Site.Params.BookRepo }}/{{ . }}/{{ $.File.Path }}" target="_blank" rel="noopener"> <img src="{{ "svg/code-fork.svg" | relURL }}" /> Edit this page - </a> + </a>{{ end }} </div> {{ end }} </div> 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 -}} |