Skip to content

Commit

Permalink
chores: update docs & package description
Browse files Browse the repository at this point in the history
  • Loading branch information
iamspark1e committed Aug 28, 2024
1 parent 0c9e9bb commit 89895e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<p align='center'>English | <a href="./README.zh.md">中文文档</a></p>
<br />
<p align='center'>A file directory-based automated multi-page Vite plugin that supports HTML templates using EJS.</p>
<p align='center'>基于文件目录的Vite自动化多页面构建插件,支持使用 EJS 的 HTML 模板。</p>
<p align='center'>A file directory-based automated multi-page Vite plugin that supports HTML templates using LiquidJS.</p>
<p align='center'>基于文件目录的Vite自动化多页面构建插件,支持使用 LiquidJS 的 HTML 模板。</p>
<br />

## Quick Start
Expand All @@ -32,7 +32,7 @@ export default defineConfig({
entryName: "main.tsx",
sharedData: {},
enableDevDirectory: true, // enable directory page will render an directory page at "http://localhost:5173/", if you have an index, it will not be affect.
ejsOption: {}
renderEngineOption: {}
})],
})
```
Expand Down Expand Up @@ -115,16 +115,16 @@ Finished, everything is ready, run `npm run build` to see what is built with `vi
*/
enableDevDirectory?: boolean
/**
* Top-level data, which will be shared to every entry during EJS render.
* Top-level data, which will be shared to every entry during LiquidJS render.
* @default {}
*/
sharedData?: object
/**
* EJS render options
* @see {@link https://github.com/mde/ejs#options}
* Render engine options, currently using LiquidJS
* @see {@link https://liquidjs.com/tutorials/options.html}
* @default {}
*/
ejsOption?: object
renderEngineOption?: object
/**
* Entries of your multi-entry application, for example, `main.js` for Vue, and `main.jsx` for React.
* @default "main.js"
Expand Down Expand Up @@ -162,7 +162,7 @@ Finished, everything is ready, run `npm run build` to see what is built with `vi
*/
template: string
/**
* EJS render data in this entry, which will be assigned with global `sharedData`
* LiquidJS render data in this entry, which will be assigned with global `sharedData`
* @default {}
*/
data?: object
Expand All @@ -183,7 +183,7 @@ export default pageConfigGenerator({

### Conditional page configuration

We have an option called `sharedData` cross pages, so you can inject the variables you need, then read them in page's config (or directly use in ejs templates), like this,
We have an option called `sharedData` cross pages, so you can inject the variables you need, then read them in page's config (or directly use in LiquidJS templates), like this,

```javascript
import { pageConfigGenerator } from 'vite-plugin-auto-mpa-html'
Expand Down
16 changes: 8 additions & 8 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<p align='center'><a href="./README.md">English</a> | 中文文档</p>
<br />
<p align='center'>基于文件目录的Vite自动化多页面构建插件,支持使用 EJS 的 HTML 模板。</p>
<p align='center'>基于文件目录的Vite自动化多页面构建插件,支持使用 LiquidJS 的 HTML 模板。</p>
<br />

## 快速使用
Expand All @@ -31,7 +31,7 @@ export default defineConfig({
entryName: "main.tsx",
sharedData: {},
enableDevDirectory: true, // 在dev环境下临时渲染一个目录页面
ejsOption: {}
renderEngineOption: {}
})],
})
```
Expand Down Expand Up @@ -114,16 +114,16 @@ export default defineConfig({
*/
enableDevDirectory?: boolean
/**
* 顶层配置的共享数据,在渲染ejs时会添加到每个入口处
* 顶层配置的共享数据,在渲染LiquidJS时会添加到每个入口处
* @default {}
*/
sharedData?: object
/**
* EJS的一些配置选项
* @see {@link https://github.com/mde/ejs#options}
* LiquidJS的一些配置选项
* @see {@link https://liquidjs.com/tutorials/options.html}
* @default {}
*/
ejsOption?: object
renderEngineOption?: object
/**
* 多页项目的每个入口文件名, 例如, Vue项目一般为`main.js`, React项目一般为`main.jsx`.
* @default "main.js"
Expand Down Expand Up @@ -163,7 +163,7 @@ export default defineConfig({
*/
template: string
/**
* 本页EJS模板使用的渲染数据,会与顶层配置的sharedData进行合并
* 本页LiquidJS模板使用的渲染数据,会与顶层配置的sharedData进行合并
* @default {}
*/
data?: object
Expand All @@ -184,7 +184,7 @@ export default pageConfigGenerator({

### 条件页面配置

借助跨页面的选项 `sharedData` ,您可以注入所需的变量,然后在页面配置中读取它们(或直接在 ejs 模板中使用),例如:
借助跨页面的选项 `sharedData` ,您可以注入所需的变量,然后在页面配置中读取它们(或直接在 LiquidJS 模板中使用),例如:

```javascript
import { pageConfigGenerator } from 'vite-plugin-auto-mpa-html'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-plugin-auto-mpa-html",
"version": "1.1.3",
"description": "A file directory-based automated multi-page Vite plugin that supports HTML templates using EJS.",
"description": "A file directory-based automated multi-page Vite plugin that supports HTML templates using LiquidJS.",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit 89895e8

Please sign in to comment.