Skip to content

Commit

Permalink
Docs for Custom Templates PR (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhsuresh authored Oct 12, 2022
1 parent bbd359d commit 1b4035f
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions app/pages/docs/cli-generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,25 @@ field to the `Task` model.
blitz generate model task subheading:string
```

<!--
### Custom templates {#custom-templates}

If you want to use custom templates with `blitz generate` instead of the
default ones (e.g. with different styles), you can provide a path to the
local directory with template files. You can specify it in your
`blitz.config.ts` file. [Read more here](/docs/blitz-config#codegen). -->
default ones (e.g. with different styles). You can specify it in your `app/blitz-server`
file by exporting the `cliConfig` object

```ts
import type { BlitzCliConfig } from "blitz"
...
export const cliConfig: BlitzCliConfig = {
customTemplates: "app/templates",
}
```

#### Generate custom templates

```bash
blitz generate custom-templates
```
The above command will generate the default templates used by blitz to a directory of your choosing in order
to provide a starting point to use this feature. It will also update the `cliConfig` configuration, in the `app/blitz-server` file,
with the latest data to allow immediate usage.

1 comment on commit 1b4035f

@vercel
Copy link

@vercel vercel bot commented on 1b4035f Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blitzjs-com – ./

blitzjs-com-git-main-blitzjs.vercel.app
blitzjs.com
blitzjs.vercel.app
blitzjs-com-blitzjs.vercel.app

Please sign in to comment.