You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please refer to the [local plugins](/developer-docs/latest/development/local-plugins-customization.md) section to know more.
347
347
348
+
## strapi generate:template
349
+
350
+
Create a template from the current strapi project
351
+
352
+
```bash
353
+
strapi generate:template <path>
354
+
```
355
+
356
+
-**strapi generate:template<path>**<br/>
357
+
Generates a Strapi template at `<path>`
358
+
359
+
Example: `strapi generate:template ../strapi-template-name` will copy the required files and folders to a `template` directory inside `../strapi-template-name`
Copy file name to clipboardExpand all lines: docs/developer-docs/latest/setup-deployment-guides/installation/templates.md
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,29 @@ To create a Strapi template, you need to publish a public GitHub repository that
76
76
77
77
First, a template's only concern should be to adapt Strapi to a use case. It should not deal with environment-specific configs, like databases, or upload and email providers. This is to make sure that templates stay maintainable, and to avoid conflicts with other CLI options like `--quickstart`.
78
78
79
-
Second, a template must follow the following file structure.
79
+
Second, a template must follow the file structure detailed below.
80
+
81
+
You can create this file structure by hand or generate it via the [CLI](/documentation/developer-docs/latest/developer-resources/cli/CLI.html#strapi-generate-template)
82
+
83
+
:::: tabs
84
+
85
+
::: tab yarn
86
+
87
+
```bash
88
+
yarn strapi generate:template <path>
89
+
```
90
+
91
+
:::
92
+
93
+
::: tab npx
94
+
95
+
```bash
96
+
npx strapi generate:template <path>
97
+
```
98
+
99
+
:::
100
+
101
+
::::
80
102
81
103
### File structure
82
104
@@ -133,9 +155,7 @@ After reading the above rules, follow these steps to create your template:
133
155
134
156
1. Create a standard Strapi app with `create-strapi-app`, using the `--quickstart` option.
135
157
2. Customize your app to match the needs of your use case.
136
-
3.Outside of Strapi, create a new directory for your template.
137
-
4.Create a `template.json` file in your template directory.
158
+
3.Generate your template using the [CLI](/documentation/developer-docs/latest/developer-resources/cli/CLI.html#strapi-generate-template) by running `strapi generate:template <path>`
159
+
4.Navigate to this path to see your generated template
138
160
5. If you have modified your app's `package.json`, include these changes (and _only_ these changes) in `template.json` in a `package` property. Otherwise, leave it as an empty object.
139
-
6. Create a `/template` subdirectory.
140
-
7. Think of all the files you have modified in your app, and copy them to the `/template` directory
141
-
8. Publish the root template project on GitHub. Make sure that the repository is public, and that the code is on the `master` branch.
161
+
6. Publish the root template project on GitHub. Make sure that the repository is public, and that the code is on the `master` branch.
0 commit comments