Skip to content

Conversation

@aomarks
Copy link
Member

@aomarks aomarks commented May 11, 2022

Previously, we used 0-indexed and left-padded tutorial URLs. For example, the 2nd step of a tutorial had URL /tutorials/<name>/#01.

Now it is 1-indexed, and not padded. For example: /tutorials/<name>/#2.

I think 0-indexed is more intuitive, because it means the URLs are aligned with the "Step 2/8" text on the page.

I think left-padding was unnecessary in URLs, plus by removing it, we have a convenient way to detect people still on the 0-indexed scheme, and fix the URLs to be 1-indexed. This way nobody will get jumped ahead if they reload before/after the new scheme is deployed.

Also fixes a bug where we would set the URL to /tutorials/<name>#2 (no trailing slash), but then after reloading it would turn into /tutorials/<name>/#2. Now we always set the final form.

@github-actions
Copy link

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr832-a23a0a4---lit-dev-5ftespv5na-uc.a.run.app/

Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz left a comment

Choose a reason for hiding this comment

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

Nice! Also tested manually in the preview url. Went over the word-viewer and async directive checking that solve and all the steps were working.

Nice!

@aomarks aomarks merged commit 41d23ea into main May 11, 2022
@aomarks aomarks deleted the tutorial-url-index branch May 11, 2022 14:32
@aomarks aomarks self-assigned this May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants