This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Craft; | |
class FractalPlugin extends BasePlugin | |
{ | |
public function init() | |
{ | |
craft()->templates->getTwig()->setLoader(new FractalTemplateLoader()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
const fractal = module.exports = require('@frctl/fractal').create(); | |
function exportPaths() { | |
const map = {}; | |
for (let item of fractal.components.flatten()) { | |
map[`@${item.handle}`] = path.relative(process.cwd(), item.viewPath); | |
} | |
fs.writeFileSync('components-map.json', JSON.stringify(map, null, 2), 'utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
function exportTemplates(args, done) { | |
const app = this.fractal; | |
const items = app.components.flattenDeep().toArray(); | |
const jobs = []; | |
for (const item of items) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const twig = require('@frctl/twig'); | |
const fractal = module.exports = require('@frctl/fractal').create(); | |
fractal.set('project.title', 'Twig + Fractal'); | |
/* | |
* Components | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* Create a new Fractal instance and export it for use elsewhere if required */ | |
const fractal = module.exports = require('@frctl/fractal').create(); | |
/* Set the title of the project */ | |
fractal.set('project.title', 'FooCorp Component Library'); | |
/* Tell Fractal where the components will live */ | |
fractal.components.set('path', __dirname + '/src/components'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"context": { | |
"bar": { | |
"title": "Title for Bar" | |
}, | |
"baz": { | |
"title": "Title for BaZ" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fractal = require('@frctl/fractal'); | |
const gulp = require('./gulpfile'); | |
fractal.command('gulp [task]', function(args, done){ | |
const task = args.task || 'default'; | |
this.console.notice(`Running gulp '${task}' task...`); | |
gulp.start(task, err => { | |
if (err) { |
NewerOlder