Socket
Socket
Sign inDemoInstall

generator-twigup

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    generator-twigup

Yeoman generator for creating html markup using Twig template engine.


Version published
Weekly downloads
1
Maintainers
1
Install size
20.8 MB
Created
Weekly downloads
 

Changelog

Source

0.3.0

Moved to twig-renderer plugin for html rendering
Removed prettify plugin
Added browser-sync task, grunt server task now runs with browser-sync
Moved jquery to version 2
Twig updated to 0.8.8

Readme

Source

generator-twigup

TwigUp is Yeoman generator for creating Html markup using Twig template engine (twig.js implementation).

Getting Started

Make sure you have Yeoman installed:

npm install -g yo

To install generator-twigup from npm, run:

npm install -g generator-twigup

Initiate generator with:

yo twigup

File structure

public                      // static resources
|- images
|- scripts
|- styles
|- vendor

views                       // contains twig views templates
|- _layouts                 // layouts templates for pages
|- _partials                // templates for partials
|- Index
   |- index.html.twig       // index page
|- Second
   |- index.html.twig       // /second page
   |- inner.html.twig       // /second/inner page

Front-end libraries

Generator will install jQuery, Require.js and normalize.css.

Grunt tasks

Generated project has 2 useful tasks aliases: server and build
server alias launches express server on port 3000 (you can change port number in Gruntfile.js). It compiles requested twig template and responses with pure html.
Rule for urls is simple: for example url http://localhost:3001/second compiles ./views/Second/index.html.twig, http://localhost:3001/second/inner compiles ./views/Second/inner.html.twig and so on.

build alias creates build folder, which contains html folder with static resources and compiled html files, root folder with files, that should be placed in root folder of production server (for now its package.json, bower.json and .bowerrc files), and views folder with all twig templates (useful for projects uses Twig template, for example Symfony framework projects).

Data for templates

data.json file contains data for templates for both tasks.

License

MIT

Keywords

FAQs

Last updated on 20 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc