Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad URLs / update 404 page #16

Open
gregjd opened this issue Nov 15, 2016 · 1 comment
Open

Fix bad URLs / update 404 page #16

gregjd opened this issue Nov 15, 2016 · 1 comment

Comments

@gregjd
Copy link
Member

gregjd commented Nov 15, 2016

https://amreldib.com/blog/FixJekyllCaseSensitiveUrlsOnGitHubPages

@gregjd gregjd mentioned this issue Dec 2, 2016
@gregjd gregjd changed the title Make URLs case-insensitive Fix bad URLs / update 404 page Dec 16, 2016
@gregjd
Copy link
Member Author

gregjd commented Dec 16, 2016

Pseudocode:

if 'state/' in URL:
    replace('state/(\w{2})', 'state'+'\1'.toUpperCase)
elif 'doc/' in URL:  # handle URLs that got a month/day added
    URL.rstrip('/')
    doc_list = [i for i in site.docs if URL in i]  # i.e. get doc/seattle-wa-2016-02-01 since it contains doc/seattle-wa-2016
    if len(doc_list) == 0:
        # show normal 404 page
    elif len(doc_list) == 1:
        # redirect to that page
    elif len(doc_list) > 1:
        # redirect to state or place page
        # or list these policies on the 404 page
# Only if I change the URL structure for places, as suggested in issue #44:
elif 'place/' in URL:
    redirect to URL.replace('place/', 'docs/')

Also: 404 page should now say to check out Browse or Search, not just Browse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant