{{ partial "course/sidebar-menu.html" (dict "context" .) }}
{{ if not (eq .RelPermalink "/course/") }} {{ partial "documentation/breadcrumbs" . }} {{ end }}
{{ partial "article-content.html" . }} {{ $parent := .Parent }} {{ if or (eq .Params.isLesson true) (eq $parent.Params.isLesson true) }}
{{ $currentWeight := .Params.weight }} {{ $targetWeight := add $currentWeight 1 }} {{ $subject := site.GetPage "course" }} {{ $allLessons := where $subject.Pages ".Params.isLesson" true }} {{ $allVideos := slice }} {{ range $lesson := $allLessons }} {{ $allVideos = $allVideos | append $lesson.RegularPages }} {{ end }} {{ $allPages := $allLessons }} {{ range $p := $allVideos }} {{ $allPages = $allPages | append $p }} {{ end }} {{ $nextLesson := where $allPages ".Params.weight" $targetWeight }} {{ if gt (len $nextLesson) 0 }} {{ $currentPage := . }} {{ $siblings := $currentPage.Parent.RegularPages }} {{ $maxWeight := 0 }} {{ range $p := $siblings }} {{ if gt (int $p.Params.weight) $maxWeight }} {{ $maxWeight = (int $p.Params.weight) }} {{ end }} {{ end }} {{ $next := index $nextLesson 0 }} {{ if eq (int $currentPage.Params.weight) $maxWeight }} {{ $subject.Params.content.nextDay }} {{ .Parent.Title }} {{ else }} {{ $subject.Params.content.nextButton }} {{ end }} {{ end }}
{{ end }}
{{ partial "table-of-contents" . }} {{ partial "documentation/footer.html" . }}