Pre-fill New File 'name' and 'content' with Query Params
Release notes
Support pre-filled New File name and contents, just like GitHub, Gitea, and (soon) Gist.
Format:
{{host}}/{{org}}/{{repo}}/-/new/{{branch}}/{{filepath}}
?filename={{filename}}
&value={{contents}}
Example:
https://git.example.com/happy/bliss/-/new/master/blog
?filename=articles/hello.md
&value=Hello+World!
See also:
- https://github.com/isaacs/github/issues/1527#issuecomment-617466083
- https://github.com/go-gitea/gitea/pull/16556/files
Problem to solve
Being able to integrate with external tools, such as Bliss, that create New File templates with pre-filled content, shortening the time it takes to create static site content with SSGs.
Proposal
Either update the frontend JavaScript, or the server code to fill in the File name
and Content
fields
with the values given from query params.
Intended users
Anybody that wants to make it easier to add content to a repo that auto-builds a site.
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Allison (Application Ops)
- Priyanka (Platform Engineer)
User experience goal
What is the single user experience workflow this problem addresses?
The user should be able to use 3rd party template tools directly from the web, without going down to the CLI, or complex custom configurations - just supply the GitLab URL, and be done.
Further details
See the Short Screen Capture Demo
For example:
- You create some content in an editor like this:
- You click "Create on GitLab"
- You get a new file, with all of the correct YAML pre-filled
Permissions and Security
No change.
Documentation
Not sure. Maybe API docs?
Availability & Testing
- End-to-end test change
What does success look like, and how can we measure that?
If I can add GitLab support for Bliss, then it worked.