From 04e88e6ca507448d46981cfb280211d2928fd517 Mon Sep 17 00:00:00 2001 From: Andrew Imeson Date: Fri, 6 Oct 2023 02:51:33 -0400 Subject: [PATCH] Rephrase template documentation to be more clear about .gitea/template (#27450) Closes #27336 --------- Co-authored-by: silverwind --- docs/content/usage/template-repositories.en-us.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/content/usage/template-repositories.en-us.md b/docs/content/usage/template-repositories.en-us.md index 4618d10f31..e57ed85cc9 100644 --- a/docs/content/usage/template-repositories.en-us.md +++ b/docs/content/usage/template-repositories.en-us.md @@ -17,9 +17,14 @@ menu: # Template Repositories -Gitea `1.11.0` and above includes template repositories, and one feature implemented with them is auto-expansion of specific variables within your template files. +Gitea (starting with version `1.11.0`) supports creating template repositories +which can be used to generate repositories based on the template, complete with +variable expansion of certain pre-defined variables. -To tell Gitea which files to expand, you must include a `template` file inside the `.gitea` directory of the template repository. +All files in the template repository are included in a generated repository from the +template except for the `.gitea/template` file. The `.gitea/template` file tells +Gitea which files are subject to the variable expansion when creating a +repository from the template. Gitea uses [gobwas/glob](https://github.com/gobwas/glob) for its glob syntax. It closely resembles a traditional `.gitignore`, however there may be slight differences. @@ -28,7 +33,7 @@ Gitea uses [gobwas/glob](https://github.com/gobwas/glob) for its glob syntax. It All paths are relative to the base of the repository ```gitignore -# All .go files, anywhere in the repository +# Expand all .go files, anywhere in the repository **.go # All text files in the text directory @@ -41,8 +46,6 @@ a/b/c/d.json **.[bB][aA][tT] ``` -**NOTE:** The `template` file will be removed from the `.gitea` directory when a repository is generated from the template. - ## Variable Expansion In any file matched by the above globs, certain variables will be expanded.