Skip to content

Add unique #id to each session in course page - #69

Open
Kobzol wants to merge 1 commit into
pyvec:masterfrom
Kobzol:course-session-id
Open

Add unique #id to each session in course page#69
Kobzol wants to merge 1 commit into
pyvec:masterfrom
Kobzol:course-session-id

Conversation

@Kobzol

@Kobzol Kobzol commented Oct 13, 2024

Copy link
Copy Markdown
Member

This allows us to provide permalinks to individual sessions.

Note that we don't want to just link to the individual session page, because it does not contain all the materials. For example, if you take a look here, the main page also contains additional materials for each session, including video links. But if you open the page for the specific session, the video links are no longer there.

It can also be a bit easier to understand for people "where are they" if they see the lesson in the context of the whole course page, rather than just seeing a page containing only a single session.

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for missing the notification on this :(

It makes sense; I'd just namespace the ID:

Comment thread naucse/templates/course.html Outdated
{% for session in course.sessions.values() %}

<div class="section{{ loop.index }}">
<div class="section{{ loop.index }}" id="{{ session.slug }}">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div class="section{{ loop.index }}" id="{{ session.slug }}">
<div class="section{{ loop.index }}" id="session-{{ session.slug }}">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done!

This allows us to provide permalinks to individual sessions.
@Kobzol
Kobzol force-pushed the course-session-id branch from 256e5f9 to ae76cc8 Compare August 15, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants