Add styles for hover and visited for table of contents

* Add styles for hover and visited for table of contents

* Add cookie based handling of visited table of content links
This commit is contained in:
Robert Linde
2017-10-04 11:39:53 +02:00
committed by Benedikt Rötsch
parent c7d0860eda
commit 58d7e87325
4 changed files with 54 additions and 4 deletions

View File

@@ -11,11 +11,11 @@ block content
.table-of-contents
.table-of-contents__list
.table-of-contents__item
a.table-of-contents__link.active(href=`/courses/${course.fields.slug}`) Course overview
a.table-of-contents__link(href=`/courses/${course.fields.slug}` class=(currentPath.endsWith(course.fields.slug) ? 'active' : '') class=(visitedLessons.includes(course.sys.id) ? 'visited' : '')) Course overview
each l in course.fields.lessons
if l.fields
.table-of-contents__item
a.table-of-contents__link(href=`/courses/${course.fields.slug}/lessons/${l.fields.slug}${queryString}`) #{l.fields.title}
a.table-of-contents__link(href=`/courses/${course.fields.slug}/lessons/${l.fields.slug}${queryString}` class=(currentPath.endsWith(l.fields.slug) ? 'active' : '') class=(visitedLessons.includes(l.sys.id) ? 'visited' : '')) #{l.fields.title}
section.layout-sidebar__content
if lesson
+lesson(lesson, course, nextLesson)