feat(courses): Add Landing Page content modules

This commit is contained in:
Khaled Garbaya
2017-09-26 14:35:53 +02:00
committed by Benedikt Rötsch
parent e2ceb39e83
commit 0c66b6678c
10 changed files with 68 additions and 10 deletions

View File

@@ -0,0 +1,8 @@
mixin copyModule(module)
.module
.module__copy
h1.module__copy__title #{module.fields.title}
h3.module__copy__headline #{module.fields.headline}
div.module__copy__copy #{module.fields.copy}

View File

@@ -1,7 +1,7 @@
mixin courseCard(course = {fields: {title: '', description: '', categories: [], slug: ''}})
.course
.course__categories
if(course.fields.categories)
if course.fields.categories
each category in course.fields.categories
a.course__categories--category(href=`categories/${category.fields.slug}`) #{category.title}
h1.course__title #{course.fields.title}

View File

@@ -0,0 +1,6 @@
mixin heroImageModule(module)
.module
.module__heroImage
h1.module__heroImage__title #{module.fields.title}
h2.module__heroImage__headline #{module.fields.headline}
img.module__heroImage__image(src=`${module.fields.backgroundImage.fields.file.url}` alt=`${module.fields.backgroundImage.fields.title}`)

View File

@@ -0,0 +1,7 @@
include ./_courseCard
mixin highlightedCourseModule(module)
.module
.module__higlightedCourse
h1.module__higlightedCourse__title #{module.fields.title}
+courseCard(module.course)

View File

@@ -0,0 +1,9 @@
include _lesson
mixin _highlightLessonsModule(module)
.module
.module__higlightedLessons
h1.module__higlightedLessons__title #{module.fields.title}
each lesson in module.fields.lessons
+lesson(lesson)

7
views/mixins/_lesson.pug Normal file
View File

@@ -0,0 +1,7 @@
mixin lesson(lesson)
.lesson
h1.lesson__tilte #{lesson.fields.title}
div.lesson__shortDescription #{lesson.fields.shortDescription}
img.lesson__image(src=`${lesson.fields.image.fields.file.url}` alt=`${lesson.fields.image.fields.title}`)