Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upMake 404 pages more useful #1558
Conversation
This comment has been minimized.
This comment has been minimized.
|
There’s a |
This comment has been minimized.
This comment has been minimized.
|
Hmm as far as I understand it |
This comment has been minimized.
This comment has been minimized.
dertieran
commented on source/features/useful-not-found-page.js in 6541347
Sep 18, 2018
|
Oh forgot to comment that, I wasn't sure if or what should be there. |
- Fetch the correct URL (it used to skip `tree/blob` entirely) - Fetch from right to left to look nicer - Reduce used elements and drop extra copy - Use plain for loops instead of multiple functional loops and flatteners
It wouldn't return cached values
If not available on page
Because this way it matches the repo header
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Nice work, thanks for continuing on my work |
| // If the resource exists in the default branch, link it | ||
| async function addDefaultBranchLink(bar) { | ||
| const parts = getCleanPathname().split('/'); | ||
| const [,,, branch] = parts; |
This comment has been minimized.
This comment has been minimized.
sindresorhus
Oct 4, 2018
Owner
I don't think we should use destructuring when it's more than one lone ,.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This is incredible useful |
This comment has been minimized.
This comment has been minimized.
|
No worries @dertieran, thanks for starting this! |
0903681
into
sindresorhus:master
This comment has been minimized.
This comment has been minimized.
|
Yay! |
| } | ||
| if (i === parts.length - 1) { | ||
| // The last part of the URL is a known 404 | ||
| bar.append(' / ', getStrikeThrough(part)); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Another one is https://github.com/sindresorhus/refined-github/issues/3515 Will ask i you want to see it on the default branch. It will include a link of https://github.com/sindresorhus/refined-github/issues/master Which puts in the search bar |
This comment has been minimized.
This comment has been minimized.
|
Excellent, I definitely didn't spend much time thinking about all the possible URLs. Can you open a joint issue for both? It should probably be limited to |


fregante commentedOct 3, 2018
•
edited
Examples:
404 file: https://github.com/sindresorhus/refined-github/blob/master/wrong-file
410 file: https://github.com/sindresorhus/refined-github/blob/master/extension/content.js
404 branch + file: https://github.com/sindresorhus/refined-github/blob/404/wrong-file
410 branch + file: https://github.com/sindresorhus/refined-github/blob/404/package.json
Closes #485
Replaces, includes and closes #1531
Depends on and includes #1557