You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
4.1 KiB

  1. {
  2. "name": "docpad-plugin-handlebars",
  3. "version": "2.2.1",
  4. "description": "Adds support for the Handlebars templating engine to DocPad.",
  5. "homepage": "http://docpad.org/plugin/handlebars",
  6. "keywords": [
  7. "docpad",
  8. "docpad-plugin",
  9. "handlebars",
  10. "templating",
  11. "templates",
  12. "render",
  13. "rendering"
  14. ],
  15. "author": {
  16. "name": "Mike Moulton",
  17. "email": "mike@meltmedia.com",
  18. "url": "http://meltmedia.com"
  19. },
  20. "maintainers": [
  21. {
  22. "name": "Mike Moulton",
  23. "email": "mike@meltmedia.com",
  24. "url": "https://github.com/mmoulton"
  25. },
  26. {
  27. "name": "Benjamin Lupton",
  28. "email": "b@lupton.cc",
  29. "url": "https://github.com/balupton"
  30. }
  31. ],
  32. "contributors": [
  33. {
  34. "name": "Mike Moulton",
  35. "email": "mike@meltmedia.com",
  36. "url": "https://github.com/mmoulton"
  37. },
  38. {
  39. "name": "Benjamin Lupton",
  40. "email": "b@lupton.cc",
  41. "url": "https://github.com/balupton"
  42. },
  43. {
  44. "name": "Tobias Birmili",
  45. "email": "birmili@mecodia.de",
  46. "url": "https://github.com/toabi"
  47. },
  48. {
  49. "name": "Gilles Bouthenot",
  50. "url": "https://github.com/gbouthenot"
  51. }
  52. ],
  53. "bugs": {
  54. "url": "http://docpad.org/plugin/handlebars/issues"
  55. },
  56. "repository": {
  57. "type": "git",
  58. "url": "https://github.com/docpad/docpad-plugin-handlebars.git"
  59. },
  60. "dependencies": {
  61. "handlebars": "~1.0.10"
  62. },
  63. "devDependencies": {
  64. "coffee-script": "~1.4.0"
  65. },
  66. "engines": {
  67. "node": ">=0.4",
  68. "docpad": "6.x"
  69. },
  70. "main": "./out/handlebars.plugin.js",
  71. "scripts": {
  72. "test": "node ./out/handlebars.test.js"
  73. },
  74. "readme": "# Handlebars Plugin for DocPad\nAdds support for the [Handlebars](http://handlebarsjs.com/) templating engine to [DocPad](https://docpad.org)\n\nConvention: `.inlinejs|js|anything.handlebars|hbs|hb`\n\n\n## Install\n\n```\nnpm install --save docpad-plugin-handlebars\n```\n\n\n## Configuration\n\n### Getting helpers and partials to work\n\nFor the plugin to support helpers and partials, you'll have to add something like the following to your [docpad configuration file](http://docpad.org/docs/config) manually:\n\n``` coffee\n# ...\nplugins:\n\thandlebars:\n\t\thelpers:\n\t\t\t# Expose docpads 'getBlock' function to handlebars\n\t\t\tgetBlock: (type, additional...) ->\n\t\t\t\tadditional.pop() # remove the hash object\n\t\t\t\t@getBlock(type).add(additional).toHTML()\n\t\tpartials:\n\t\t\ttitle: '<h1>{{document.title}}</h1>'\n\t\t\tgoUp: '<a href=\"#\">Scroll up</a>'\n# ...\n```\n\n\n## Usage as precompiler\n\nIf the document extension is `.inlinejs|js.handlebars|hbs|hb`, the plugin will produce a precompiled template. In this case, you can customise the precompiled template via the following:\n\n``` coffee\n# ...\nplugins:\n\thandlebars:\n\t\tprecompileOpts:\n\t\t\twrapper: \"default\"\n# ...\n```\n\nAvailable values for the wrapper option are:\n\n- `\"default\"`: Produces a handlebars wrapper like:\n\t``` javascript\n\t(function() {\n\t\tvar template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};\n\t\ttemplates['theSlugOfTheFile'] = template(function (Handlebars,depth0,helpers,partials,data) {\n\t\t\t...\n\t\t})\n\t})();\n\t```\n\n- `\"amd\"`: Produces a AMD handlebars wrapper like:\n\t``` javascript\n\tdefine(['handlebars'], function(Handlebars) {\n\t\tvar template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};\n\t\ttemplates['theSlugOfTheFile'] = template(function (Handlebars,depth0,helpers,partials,data) {\n\t\t\t...\n\t\t});\n\t});\n\t```\n\n- `\"none\"`: Produces a basic wrapper like:\n\t``` javascript\n\tfunction (Handlebars,depth0,helpers,partials,data) {\n\t\t...\n\t}\n\t```\n\n\n\n## History\n\nYou can discover the history inside the `History.md` file\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n<br/>Copyright &copy; 2012 [Mike Moulton](http://meltmedia.com)",
  75. "readmeFilename": "README.md",
  76. "_id": "docpad-plugin-handlebars@2.2.1",
  77. "_from": "docpad-plugin-handlebars@~2.2.1"
  78. }