Course lesson

Scaffold a New Blog Post Article Automatically With Nx Workspace Generators

Once we finish our portfolio site, hopefully, one of the main activities we'd be doing with it is to create new content. Thus we want to automate the creation of a new blog article, which includes the creation of a new MDX file in the articles folder as well...

Duration
8 min
Access
Free
Transcript
Available

Once we finish our portfolio site, hopefully, one of the main activities we'd be doing with it is to create new content. Thus we want to automate the creation of a new blog article, which includes the creation of a new MDX file in the _articles folder as well as initialize the article's front matter with the title, author, and creation date.

Nx has a powerful concept, called generators. While many of them come already built into the Nx plugins (e.g. @nrwl/next, @nrwl/react,...), we can also define our own, Nx Workspace Generators. This is exactly what we leverage to scaffold new blog articles.

Prefer to read along as well? Here's the accompanying article