Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create courses with auromatic links to lectures #21

Open
lorenzo-sani opened this issue Apr 23, 2020 · 1 comment
Open

Create courses with auromatic links to lectures #21

lorenzo-sani opened this issue Apr 23, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@lorenzo-sani
Copy link
Collaborator

lorenzo-sani commented Apr 23, 2020

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>')
@lorenzo-sani lorenzo-sani added the enhancement New feature or request label Apr 23, 2020
@willu47
Copy link
Contributor

willu47 commented Apr 23, 2020

An extension of this would be to write a liquid script which auto-generates a course page containing the list of lectures contained within that course from the course: x frontmatter tag.

Then, the only task for the Python script would be to add the course tag to the front matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants