Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Mar 15, 2021
1 parent aa804d2 commit f4ebaea
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,41 +96,9 @@ watch.init accepts config with following options:
- `assets`: array of node module names to be copied to `static/assets` folder. **not stable feature.**


## i18n
## Additional information

prepare i18n content under langauges folder (e.g., `en` or `zh-tw`) in `locales` folder, in `yaml` format. Filename maps to `namespace` concept in `i18next`.

i18n data can be used in pug files via `i18n` function. e.g.,

div= i18n("my-key")

will show `my-key` content defined in locale corresponding `default.yaml`:

my-key: 這是我的鍵


To use a namespaced key, add `:` before key. For example:

div= i18n("new-ns:another-key")

will access to `another-key` in `new-ns.yaml`. Be sure to add your namespace name in `ns` field of i18n option:

"i18n": { ... "ns": ["default", "new-ns"] }

additionally, use `intlbase` to wrap path with a i18n based relative path:

a(href=intlbase('/faq'))


## Pug Include Path

Use `@` to include files in modules:

include @/ldview/dist/ldview.pug

Use `@static` to include files under `static` folder:

include @static/assets/sample.pug
`template` now use `@plotdb/srcbuild` for source building, and thus there are some additional features available and documented in `@plotdb/ssrcbuild`. Please refer to [@plotdb/srcbuild](https://github.com/plotdb/srcbuild) for more information.


## TODO
Expand Down

0 comments on commit f4ebaea

Please sign in to comment.