-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Pre-fill suggested New File 'name' and 'content' with Query Params #16556
Conversation
|
@lunny this won't create the file, it will only pre-fill the textarea to suggest content. The user will need to hit "Submit" to do a POST and then the file will be created. |
I still think we should have a ctx.Query who do action on query of url directly but this is not the scope of this pull |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to hold you back but ...
... it works all right beside you have to edit the filename box in UI to enable the beside that it's good to go |
@6543 It looks like you already pushed a commit to revert it? I see "1 change requested", but I don't see what change is request. |
6ed3869
to
841a68b
Compare
@coolaj86 happy blogging :) |
…o-gitea#16556) * feature: add (GitHub-style) querystrings for pre-filling new file content * docs: add query parameters for new files
Re: #16398
Use the same GET as the "New File" link, as seen here:
And allow 3rd-party frontends to append
?filename=x&value=y
to pre-populate the form:See also: Screen Capture Demo.
Pre-Fill New File Name & Contents w/ Query Params
If you'd like to open the New File page with suggested name and contents,
you can do so with the
filename
andvalue
query parameters (just like GitHub):For example:
This mirrors the documented behavior of Github, and fixes the known bug. Gist will also have this feature soon.
For Integration with File Templates
This allows you to use File Templating tools such as Bliss - which allows you to create blog articles, with FrontMatter, for Static Site blogs - acting as a de facto frontend for such platforms.
Test Binary