Files
the-example-app-nodejs/views/mixins/_lesson.pug

30 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
include _editorialFeatures
include _lessonModuleCodeSnippet
include _lessonModuleCopy
include _lessonModuleImage
mixin lesson(lesson, course, nextLesson)
.lesson
h1.lesson__title #{lesson.fields.title}
+editorialFeatures(lesson)
if lesson.fields.image
img.lesson__image(src=`${lesson.fields.image.fields.file.url}` alt=`${lesson.fields.image.fields.title}`)
.lesson__modules
each module in lesson.fields.modules
if module.sys.contentType
case module.sys.contentType.sys.id
when 'lessonCodeSnippets'
+lessonModuleCodeSnippet(module)
when 'lessonCopy'
+lessonModuleCopy(module)
when 'lessonImage'
+lessonModuleImage(module)
else
h2 #{translate('lessonModuleErrorTitle', currentLocale.code)}
p
span #{translate('lessonModuleErrorBody', currentLocale.code)}
strong #{module.sys.id}
if nextLesson
a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)}