https://github.com/phase2/grav-plugin-twig-namespaces
A Grav CMS plugin for custom Twig namespaces
https://github.com/phase2/grav-plugin-twig-namespaces
Last synced: 9 months ago
JSON representation
A Grav CMS plugin for custom Twig namespaces
- Host: GitHub
- URL: https://github.com/phase2/grav-plugin-twig-namespaces
- Owner: phase2
- License: mit
- Created: 2018-03-09T21:40:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T18:24:48.000Z (almost 8 years ago)
- Last Synced: 2025-01-12T17:36:14.725Z (about 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Twig Namespaces Plugin
This plugin adds Twig Namespacing capabilities to [Grav CMS](http://github.com/getgrav/grav). This means that you can write things like `{% include "@atoms/button" %}` and Grav will know where to look.
## Installation
To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `twig-namespaces`. You can find these files on [GitHub](https://github.com/phase2/grav-plugin-twig-namespaces).
You should now have all the plugin files under
/your/site/grav/user/plugins/twig-namespaces
> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav) and the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) to operate.
## Configuration
Before configuring this plugin, you should copy the `user/plugins/twig-namespaces/twig-namespaces.yaml` to `user/config/plugins/twig-namespaces.yaml` and only edit that copy.
Here is the default configuration and an explanation of available options:
```yaml
enabled: true
namespaces: // Array of namespaces
test: // Namespace to be used in twig files as `@test`.
paths: // Array of paths
- path to folder containing twig files to be included in namespace
- another path be included for namespaces
```