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

Godlike editing speed: redirecting to /add_new if page does not exist #94

Merged
merged 6 commits into from
Feb 15, 2023

Conversation

reactorcoremeltdown
Copy link
Contributor

Summary

Instead of showing a traceback error page, we can do something more useful: prompt a user to create a new page if it does not exist! Bonus: by using ?page= url parameter we can specify which page we are going to edit. See the example below.

editing

Details

Before displaying a page, wikmd checks mtime of a file. If a file does not exist, it will throw a FileNotFound error. We can catch this error and do a redirect instead. More to that, we can pass a page name as an argument to the /add_new route and therefore put the path to a page right into a template.

Checks

  • In case of new feature, add short overview in docs/<corresponding file>
  • Tested changes

@Linbreux
Copy link
Owner

Hi @reactorcoremeltdown

Nice to keep getting handy updates from your part. This looks great, I think it would definitely be useful for some users!

@Linbreux Linbreux merged commit cfc6244 into Linbreux:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants