Use 1-indexed and non-padded tutorial URLs #832
Merged
+44
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.