Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miyagi-dev/twig-drupal
https://github.com/miyagi-dev/twig-drupal
drupal twig twigjs
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/miyagi-dev/twig-drupal
- Owner: miyagi-dev
- Created: 2022-07-16T07:30:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T09:43:59.000Z (5 months ago)
- Last Synced: 2024-10-08T05:04:12.311Z (about 1 month ago)
- Topics: drupal, twig, twigjs
- Language: JavaScript
- Homepage: https://www.miyagi.dev
- Size: 448 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @miyagi/twig-drupal
This extension adds support for specific twig and Drupal functionality to [@miyagi/core](https://npmjs.com/package/@miyagi/core).
## Features
### Drupal attributes
- `addClass`
- `setAttribute`[More about Drupal attributes](https://www.drupal.org/docs/8/theming-drupal-8/using-attributes-in-templates)
To use Drupal attributes in your mock files, add `$drupal: true` to the object.
### twig
**NOTE:** If you need to add additional filters, functions or tags, please refer to the [_miyagi_ documentation](https://docs.miyagi.dev/configuration/extending-template-engine/).
#### Functions and filters
This plugin uses [twig-drupal-filters](https://www.npmjs.com/package/twig-drupal-filters), so all its functions and filters are supported.
#### Tags
- `trans` / `endtrans`
- `plural`## Installation
```bash
npm i --save-dev @miyagi/twig-drupal
```or
```bash
yarn add -D @miyagi/twig-drupal
```### Usage
Add the extension to your `.miyagi.js` like this:
```js
module.exports = {
extensions: [require('@miyagi/twig-drupal')],
...
}
```