Pre-fill suggested New File 'name' and 'content' with Query Params (#16556)
* feature: add (GitHub-style) querystrings for pre-filling new file content * docs: add query parameters for new files
This commit is contained in:
parent
4e68d6f41d
commit
b9a0e33238
3 changed files with 35 additions and 3 deletions
|
@ -24,3 +24,22 @@ If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#user-conten
|
|||
an [SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk),
|
||||
or even some extra [themes](https://gitea.com/gitea/awesome-gitea#user-content-themes),
|
||||
you can find them listed in the [awesome-gitea](https://gitea.com/gitea/awesome-gitea) repository!
|
||||
|
||||
## Pre-Fill New File name and contents
|
||||
|
||||
If you'd like to open a new file with a given name and contents,
|
||||
you can do so with query parameters:
|
||||
|
||||
```txt
|
||||
GET /{{org}}/{{repo}}/_new/{{filepath}}
|
||||
?filename={{filename}}
|
||||
&value={{content}}
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```txt
|
||||
GET https://git.example.com/johndoe/bliss/_new/articles/
|
||||
?filename=hello-world.md
|
||||
&value=Hello%2C%20World!
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue