wearewondrous / fractal-twig-drupal-adapter

Twig template adapter for Fractal with Drupal 8 directives.
http://fractal.build
MIT License
13 stars 13 forks source link

Support for extend, include, if etc? #6

Open mottihoresh opened 6 years ago

mottihoresh commented 6 years ago

Hi I am having some issues with the adapter, it's recognizing any of the twig syntax.

'use strict';

/*
* Require the path module
*/
const path = require('path');

/*
 * Require the Fractal module
 */
const fractal = module.exports = require('@frctl/fractal').create();

const twigAdapter = require('@wondrousllc/fractal-twig-drupal-adapter');
const twig = twigAdapter({
  handlePrefix: '@components'
});

/*
 * Look for twig files instead of hbs files.
 */
fractal.components.set('ext', '.twig'); // default is '.hbs'

/*
 * Give your project a title.
 */
fractal.set('project.title', 'Apricot Atomic Design System');

/*
 * Tell Fractal where to look for components.
 */
fractal.components.set('path', path.join(__dirname, 'patterns/components'));

/*
 * Tell Fractal where to look for documentation pages.
 */
fractal.docs.set('path', path.join(__dirname, 'patterns/docs'));

/*
 * Tell the Fractal web preview plugin where to look for static assets.
 */
fractal.web.set('static.path', path.join(__dirname, 'patterns/public'));
mottihoresh commented 6 years ago

OK I've found the issue, might want to update the docs.

I've added: fractal.components.engine(twig);

right before defining the extension.

fgm commented 4 years ago

Looks like this issue could be closed since #7 got merged ?