Fix course next button + menu upd (#1959)

* fix the next button in the course

* removing course name dependency

* rename the next button

* articles -> learn in the docs menu
This commit is contained in:
trean
2025-10-23 00:50:23 +02:00
committed by GitHub
parent 672ec957c1
commit 01bcf8147c
44 changed files with 55 additions and 45 deletions
@@ -20,13 +20,23 @@
<div class="d-flex justify-content-lg-end pb-3 pt-4">
{{ $currentWeight := .Params.weight }}
{{ $targetWeight := add $currentWeight 1 }}
{{ $subject := site.GetPage "course" }}
{{ $subject := "" }}
{{ if eq .Params.isLesson true }}
{{/* Current page is a lesson (_index.md), parent is the course section */}}
{{ $subject = .Parent }}
{{ else }}
{{/* Current page is inside a lesson, grandparent is the course section */}}
{{ $subject = .Parent.Parent }}
{{ end }}
{{ $allLessons := where $subject.Pages ".Params.isLesson" true }}
{{ $allVideos := slice }}
{{ range $lesson := $allLessons }}
{{ $allVideos = $allVideos | append $lesson.RegularPages }}
{{ range $video := $lesson.RegularPages }}
{{ $allVideos = $allVideos | append $video }}
{{ end }}
{{ end }}
{{ $allPages := $allLessons }}