Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

generator-twigup

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-twigup

Yeoman generator for creating html markup using Twig template engine.

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 20 Feb 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc