添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

@magnolia/cli-freemarker-prototypes

1.0.1 Public • Published

Cli Freemarker Prototypes

Package for @magnolia/cli-create-component-plugin and @magnolia/cli-create-page-plugin that provides Freemarker component and page prototypes.

Usage

To use these prototypes with @magnolia/cli-create-component-plugin or @magnolia/cli-create-page-plugin, follow these steps:

Running the Command:

If the framework is not configured in mgnl.config.js, running:

npm run mgnl -- create-component Hero 

will prompt you to choose a framework. The selected framework will then be saved in mgnl.config.js.

Configuring the Framework:

Alternatively, you can predefine the framework in mgnl.config.js to use it automatically:

import CreatePagePlugin from "@magnolia/cli-create-page-plugin";
import CreateComponentPlugin from "@magnolia/cli-create-component-plugin";
export default {
  // Other configurations...
  plugins: [
    new CreatePagePlugin({
      framework: '@magnolia/cli-freemarker-prototypes@<version>',
      // Additional properties...
    }),
    new CreateComponentPlugin({
      framework: '@magnolia/cli-freemarker-prototypes@<version>',
      // Additional properties...
    }),

Available prototypes

Component prototypes

basic: variant contains a component in dialogs folder with example properties empty: variant does not contain any component in dialogs folder and dialog: __dialog__ is missing in .ftl file with-js-model: variant contains a component in dialogs folder with example properties and contains an example .js file which can be used in .ftl file

Page prototypes

basic: variant contains a page in dialogs folder with example properties empty: variant does not contain any page in dialogs folder and dialog: __dialog__ is missing in .ftl file with-js-model: variant contains a page in dialogs folder with example properties and contains an example .js file which can be used in .ftl file

Prototype Documentation

For detailed documentation of the Freemarker Prototypes, please refer to Prototype Documentation

Plugins Documentation