Conversation
A Contribution for URL shortcut, now, Abbreviation .html directs to the exact page!
jmanico
left a comment
There was a problem hiding this comment.
I am approving just to move this along but can other folks take a closer look at this before we merge?
|
This is fantastic. I'm going to do a full review on it hopefully in the next day or two but I'm really excited about this. Thank you! |
|
This is fantastic - thank you very very much! |
|
Build is failing here @Farreeda |
scripts/Generate_Site_mkDocs.sh
Outdated
| echo " - /${shortcut}.html" | ||
| else | ||
| #echo "❌ Failed to create shortcuts for ${shortcut}" | ||
| fi |
There was a problem hiding this comment.
The script fails here, I assume because there's nothing in the else clause except for the comment. Uncommenting the line fixes this.
However, when I run this locally and run make serve the shortcuts don't seem to work. I also don't see where the script reads redirects.yml - it looks like the script is automatically generating the shortcuts which makes me wonder how it will handle possible duplicates. Can you please clarify the process?
There was a problem hiding this comment.
Thank you for your feedback, @szh! I appreciate your insights and apologize for not testing every case @mackowski. The redirects.yml file now includes abbreviations for each path, and it can be easily modified and updated as needed. The XSS and auth issues should be resolved now, but please note that abbreviations should be followed by .html
Thank you, @jmanico, for bringing attention to my PR!
|
@szh can you review it again? |
|
Sorry for the delay, I've been busy. I'll try to review it this week. |
|
I'm ready to approve. Just one question - I see it generates both the clean urls like |
|
The issue happens because the shortcut files (without .html) are being treated as raw files instead of actual HTML pages when accessed in a browser. The browser doesn't know how to interpret them, so it downloads them instead of rendering.
The issue happens because the shortcut files (without .html) are being treated as raw files instead of actual HTML pages when accessed in a browser. The browser doesn't know how to interpret them, so it downloads them instead of rendering. |
|
OK, so maybe we should just not create them? Or maybe there's some kind of config file (like a .htaccess file) that can instruct the server to serve them as html? |
|
Thank you for re-checking my PR @mackowski. |
I'd prefer to fix it before we merge :) |
|
ping |
|
Hello. After a year. |
|
Website build failed. not sure what to approve here. |
|
Add URL Shortening for Cheat Sheets
Description
This PR adds automatic URL shortening functionality to make cheat sheets more accessible through memorable shortcuts. Instead of typing long URLs, users can now access cheat sheets using abbreviated paths.
For example:
/XSS.html→cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html/SSRF.html→cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html/SQLi.html→cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.htmlChanges
Generate_Site_mkDocs.sh/XSS.html)Testing
After running
Test shortcuts:
Benefits
Related Issues
Closes #1300