loreanvictor / tmplr-template-example

An example template that will automatically fill some files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Template Repo Example for tmplr

This is an example template repository using tmplr for templating.

๐Ÿ‘‰ If you click on Use this template button above, it will automatically apply the template recipe and create an apt README for you.

๐Ÿ‘‰ If you create an empty repo, you can still apply this template on it using the following command:

npx tmplr loreanvictor/tmplr-template-example

๐Ÿ‘‰ If you want, you can also use this repository on a normal (not git controlled) folder using the same command. In that case, it will ask a few questions from you to fill out the details: demo



How does it work?

The templating recipe can be found in .tmplr.yml. The recipe specifies how to resolve values required for templating (like name of the owner of the repo, their email, name of the project, etc.) based on the execution context: if it finds the appropriate environment variables (for example, set by the CI or GitHub Action workflows), it will use them, otherwise it will try to read local data (git information, name of current folder, etc.), and if none are available, it will prompt the user.

There is also an initialization workflow that runs when the template is used (basically the first push), executes the recipe using tmplr and then removes all templating artifacts, to ensure that templating workflow is only executed once.

For more information, you can checkout the template README, which will be filled up and used when the template recipe is executed, or checkout tmplr's docs for more information.



logo-dark logo-light

About

An example template that will automatically fill some files.

License:MIT License