Skip to content

Create courses with auromatic links to lectures #21

Open
@lorenzo-sani

Description

@lorenzo-sani

Instead of manually creating the links to the lectures contained in one course, it would be possible to automatically create those links calling the frontmatter variable course assigned to the lectures when they are added to a course.

Problem: with this method, we lose the option of deciding in which order we should display the lectures contained in one course

course_text.append('\n***Lectures contained in this course:***\n')
course_text.append('<ul class="post-list">\n')
course_text.append('{% assign lectures = site.posts | where: "categories","lecture" %}\n')
course_text.append('{% for lecture in lectures %}\n')
course_text.append('{% if lecture.course contains page.title%}\n')
course_text.append('<p><a href="{{ lecture.url | relative_url }}">{{ lecture.title | escape }} </a></p>\n')
course_text.append('{% endif %}{% endfor %}</ul>')

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions