Giter Club home page Giter Club logo

docpad-plugin-partials's Introduction

Partials Plugin for DocPad

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

This plugin provides DocPad with Partials. Partials are documents which can be inserted into other documents, and are also passed by the docpad rendering engine.

Usage

Create the src/partials directory, and place any partials you want to use in there.

Then call the new partial(filename, objs...) template helper to include the partial. The object arguments are optional, and can be used to send custom data to the partial's template data. Setting the first object argument to false will not send over the template data by default.

Examples

Lets say we have the partial src/partials/hello.html.eco that includes:

Hello <%=@name or 'World'%> Welcome to <%= @site?.name or 'My Site' %>

And a docpad configuration file file that includes:

templateData:
	site:
		name: "Ben's Awesome Site"

We could then render via a src/documents/index.html.eco document in these different ways:

<!-- Include the rendered contents of `src/partials/my-partial` file -->
<!-- and send over the template data -->
<%- @partial('hello') %>
<!-- gives us:
Hello World
Welcome to Ben's Awesome Site
-->

<!-- Include the rendered contents of `src/partials/my-partial` file -->
<!-- and send over the template data -->
<!-- and send over our own custom template data -->
<%- @partial('hello', {name:'Ben'}) %>
<!-- gives us:
Hello Ben
Welcome to Ben's Awesome Site
-->

<!-- Include the rendered contents of `src/partials/my-partial` file -->
<!-- and DO NOT send over the template data -->
<%- @partial('hello', false) %>
<!-- gives us:
Hello World
Welcome to My Site
-->

<!-- Include the rendered contents of `src/partials/my-partial` file -->
<!-- and DO NOT send over the template data -->
<!-- and send over ONLY our own custom template data -->
<%- @partial('hello', false, {name:'Ben'}) %>
<!-- gives us:
Hello Ben
Welcome to My Site
-->

<!-- Include the rendered contents of `src/partials/my-partial` file -->
<!-- and DO NOT send over the template data -->
<!-- and send over our own custom template data with the template data site property -->
<%- @partial('hello', false, {site:{name:@site.name}}, {name:'Ben'}) %>
<!-- gives us:
Hello Ben
Welcome to Ben's Awesome Site
-->

Notes

To increase performance it is recommended you only include the exact template data variables that you need - this is because sending over all the template data can be a costly process as we much destroy all references (do a deep clone) to avoid reference conflicts and over-writes between each render - so sending over as little / as specific data as possible means less reference destroying which means faster processing.

If your partial only needs to be rendered once per (re)generation then you can specify cacheable: true in the partial's meta data, doing so greatly improves performance.

Partials actually render asynchronously, when you call <%- @partial('hello') %> you'll actually get back something a temporary placeholder like [partial:0.1290219301293] while your template is rendering, then once your template has rendered, and once all the partials have rendered, we will then go through and replace these placeholder values with the correct content. We must do this as template rendering is a synchronous process whereas document rendering is an asynchronous process. More info here.

Compatibility

  • Versions 2.8.0 and above DO send the template data by default. You can turn this off by using false as the first object argument or by setting performanceFirst: true in your plugin's configuration options.

  • Versions below 2.8.0 DO NOT send the template data by default. You must add it by using @ or this as the first object argument like so: <%- @partial('my-partial', @) %>

Install

Install this DocPad plugin by entering docpad install partials into your terminal.

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

docpad-plugin-partials's People

Contributors

balupton avatar bobvanderclay avatar delapouite avatar iredmedia avatar patocallaghan avatar patuf avatar vsopvsop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docpad-plugin-partials's Issues

2.11.0 memory leak

2.10.0 worked without a problem, but 2.11.0 seems to be leaking memory.
Large projects can't allocate enough memory, but it works for smaller projects.

Unable to call @getCollection("partials") from docpad.coffee

Hey,

I've come across an issue where it seems that I can't define a collection in my docpad.coffee that tries to access partials e.g. @getCollection('partials').

By chucking in some debug statements it seems that the functions for the collections in docpad.coffee are running before PartialsPlugin.populateCollections is called so it's always undefined. But instead if I call @getCollection from within one of my documents it works fine.

//Fails in docpad.coffee, returns undefined
collections:
     objects: ->
            @getCollection("partials").findAllLive({isObject:true})

//Works okay in index.html.eco
<% for object in @getCollection("partials").findAllLive({isObject:true}).toJSON(): %>

I've attached a debug log here.

If you want to replicate the issue it's occurring on my repo here. You'll just have to uncomment the collections in docpad.coffee.

Thanks,
Pat

TypeError: Object #<Object> has no method 'getPreparedTitle'

What I did:

  • Updated the local docpad (which was generated from generator-docpad) from 6.56.0 to 6.69.2
  • It was not working immediately.
  • So I removed package.json and node_modules directory and started installing local docpad from scratch
  • I installed all my plugins except docpad-plugin-partials and docpad run works fine generating content.
  • docpad install partials
  • Insert code for partials
<%- @partial('favicon', false) %>
  • docpad run produced a long list of errors with no method 'getPreparedTitle'
    Here is a sample:
TypeError: Object #<Object> has no method 'getPreparedTitle'
  at Object.eval (<anonymous>:43:34)
  at Object.eval (<anonymous>:157:8)
  at eval (<anonymous>:159:6)
  at Function.eco.render (/home/akshay/project/node_modules/docpad-plugin-eco/node_modules/eco/lib/index.js:26:25)
  at EcoPlugin.render (/home/akshay/project/node_modules/docpad-plugin-eco/out/eco.plugin.js:23:32)
  at ambi (/home/akshay/project/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:57:27)
  at Task.<anonymous> (/home/akshay/project/node_modules/docpad/node_modules/event-emitter-grouped/out/lib/event-emitter-grouped.js:45:23)
  at ambi (/home/akshay/project/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:55:18)
  at fire (/home/akshay/project/node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:384:27)
  at b (domain.js:183:18)
  at Domain.run (domain.js:123:23)
  at Task.fire (/home/akshay/project/node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:398:25)
  at Object._onImmediate (/home/akshay/project/node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:414:26)
  at processImmediate [as _immediateCallback] (timers.js:354:15)
$ docpad --version 
v6.69.2 (local installation: /home/akshay/project/node_modules/docpad)
$ node --version
v0.10.35
$ npm --version
2.1.17

Operating system: Arch linux, 64 bit

Here is a comparison of all that changed: learnlearnin/learnlearnin.github.io@cc83b21...fddc473

Undefined is not a function - .match()

On line 222 of your plugins file (or line 183:50 in the generated js file) the .match() was complaining that it didn't exist. I did a simple console out of the opts.content, and it appeared to be HTML.

I fixed the issue by adding a .toString()

partialContainers = (opts.content || '').toString().match(partialContainerRegex) || [];

I assume this shouldn't need to happen and maybe I'm doing something wrong. But this error flew the instant I added this plugin (before I even had anything else setup).

Nested Partials Support

ReferenceError: /Users/foo/Code/JavaScript/docpad-test/src/partials/cron-section.html.jade:5
    3| section.cron-jobs
    4|   .carousel.slide
  > 5|     .carousel-inner
    6|       != partial('test.html.jade')

partial is not defined

can't access @feedr in partial

same file renders file when placed under documents but if i have it under partials and call it from layout then i get

warning: Rendering partial failed: links.html.coffee. The error follows:
warning: An error occured: 
TypeError: Cannot read property 'feeds' of undefined

Rendering partial inside a highlightjs block

I have a code snippet that I want to reuse across multiple pages, I created a partial and when I tried to render it along other code inside a highlightjs code block I received the following error :

error: An error occured:
TypeError: Cannot read property 'task' of undefined

Note: Moving the partial call outside hljs code block works fine.

page.html.eco

<pre>
<code class="lang-javascript">
function sample(){ 
}

<%- @partial('snippet') %>

function example(){ 
}

</code> 
</pre>

snippet.html.eco

function common(){

}

environment

docpad --version
v6.69.0

node --version
v0.10.26

npm --version
v1.4.3

OS
Windows 7 Enterprise x64

Getting access to the content of the partial

Hey,

I'm trying to do the following but can't seem to get it working.

I have a html partial which I am pulling into my page but I am also trying to html escape the output of the partial. For example, I have <p>test</p> in my partial but I want it to be output on the page as &lt;p&gt;test&lt;/p&gt; I do this as I'm trying to put the contents of the partial into a pre tag. I'm using this package to do the html escaping.

In my docpad.coffee I have:

escape: require('escape-html')

and in my template I call:

<%-escape(@partial('objects/code/block-list.html')) %>

but this outputs as:

%5Bpartial%3A0.9582784192170948%5D

Have you any ideas how I can access the contents of the partial to escape them?

Thanks,
Pat

npm error

I tried to 'npm install --save docpad-plugin-partials' but got this....

npm http GET https://registry.npmjs.org/docpad-plugin-partials
npm http 304 https://registry.npmjs.org/docpad-plugin-partials
npm http GET https://registry.npmjs.org/extendr
npm http GET https://registry.npmjs.org/taskgroup
npm http 304 https://registry.npmjs.org/extendr
npm http 304 https://registry.npmjs.org/taskgroup
npm http GET https://registry.npmjs.org/typechecker
npm http GET https://registry.npmjs.org/ambi
npm http GET https://registry.npmjs.org/eventemitter2
npm http 304 https://registry.npmjs.org/ambi
npm http 304 https://registry.npmjs.org/typechecker
npm http 304 https://registry.npmjs.org/eventemitter2
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
[email protected] node_modules\docpad-plugin-partials
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

Then I tried 'npm install --save docpad-plugin-partials' got this....

npm http GET https://github.com/docpad/docpad-plugin-partials.git
npm http 200 https://github.com/docpad/docpad-plugin-partials.git
npm ERR! not a package C:\Users\ADMINI1\AppData\Local\Temp\npm-6400\1370678268655-0.7309298755135387\tmp.tgz
npm ERR! Error: ENOENT, open 'C:\Users\ADMINI
1\AppData\Local\Temp\npm-6400\1370678268655-0.7309298755135387\package\package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "https://github.com/docpad/
cpad-plugin-partials.git"
npm ERR! cwd F:\github\blog
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! path C:\Users\ADMINI~1\AppData\Local\Temp\npm-6400\1370678268655-0.7309298755135387\package\package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! F:\github\blog\npm-debug.log
npm ERR! not ok code 0

Could anyone tell me how to install it..?

Inject meta-data from the partial

Usually when building a Partial, you have something like:

Hello <%=@name or 'World'%>
Welcome to <%= @site?.name or 'My Site' %>

Now, what if you could inject meta-data to the document from the Partial itself?


---
someData: "Oh, yes please."

---
Hello <%=@name or 'World'%>
Welcome to <%= @site?.name or 'My Site' %>

Then calling @partial('mypartial') would manipulate the source document's meta-data.

Partials don't work with layout named 'document'

As states in topic, when you call layout like this and try to use partial, rendering hangs with no error whatsoever, with -d you can see it is trying to render those files, but loops infinitely.

Partial should return empty string, now prints '???'.

The latest updates had an unexpected effect on my site.

I have a couple partials that work like this:

<% if @document.relatedDocuments.length: %>
    <h3>Related</h3>
    <ul class="list">
        <% for document in @document.relatedDocuments: %>
            <li>
                <a href="<%= document.url %>"><%= document.title %></a><br>
                <span class="caption"><%= document.subtitle %></span>
            </li>
        <% end %>
    </ul>
<% end %>

If I have any relatedDocuments, show them. Otherwise do nothing. It's been working fine until the latest update, and now it prints "???".

I saw this line in the code:

partial.result = result ? err?.toString() or '???'

If I'm understanding it correctly, the empty string result of the rendered partial is being evaluated as false, thus the '???'.

Is this the intended behavior? In my case, I feel the empty string is a valid result, and perhaps that line should test explicitly for false. I could be wrong, however.

Interestingly enough, it works find if I add an empty else clause, like so:

<% if @document.relatedDocuments.length: %>
    <h3>Related</h3>
    <ul class="list">
        <% for document in @document.relatedDocuments: %>
            <li>
                <a href="<%= document.url %>"><%= document.title %></a><br>
                <span class="caption"><%= document.subtitle %></span>
            </li>
        <% end %>
    </ul>
<% else: %>
<% end %>

Thanks for your help!

Unnecessary hard-coding of src/partials during render

The partial plugin creates a custom query to discover partial documents:

.setQuery('isPartial', {
	$or:
		isPartial: true
		fullPath: $startsWith: config.partialsPath  # src/partials
})

Notably, $or: allows a document to be discovered outside of the src/partials folder by merely including isPartial: true in the metadata. However, when time to render the documents, the below is hardcoded, making partials outside the src/partials folder give rise to an error:

partialFuzzyPath = pathUtil.join(config.partialsPath, partialName)
partial.document ?= docpad.getCollection('partials').fuzzyFindOne(partialFuzzyPath)

cache partials

It would be great if it was possible to cache partials by a parameter.
For instance, i use some partials across different languages, and i would like to be able to cache them by language.

Additional configuration

Would be awesome if by changing configuration of the plugin I could activate behavior, that if partial doesn't exist, error is thrown and generation is stopped.

Just info rendered in a file, saying partial doesn't exist is not very handy. When you have a lot of content and partials, you need a proper information on the console that partial with specific name is missing and generation must stop (cause who's checking warnings after all :))

Partials don't see their metadata

Hi,
is there any way to use current partial metadata like in documents?
I mean something like this:


---
title: My awesome blog post
meaningOfLife: 42

---
What is the meaning of life? <%= @document.meaningOfLife %>

Rendering wrong partial when it has similar names

I'm using partials as components and sometimes it has a prefix on it, per example:

  • box1_example1
  • box1_example2

Sometimes, it renders box_example_2 in place of box_example_1. It seems that it doesn't get the name after underscore.

I've tried to use "-" instead of "_" and got the same issue.

doesn't work on windows

Hey, I notice that my site partials get rendered as if they were just .html rather than .html.eco when I'm on Windows, so I grabbed a copy of the partials plugin and sure enough, the tests fail on Windows (they all pass on my mac.)

Here's a full copy of the console output:

$ cake test
cake compile
cake install
npm install (for app)
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\cson requires coffee-script@'~1.7.1' bu
t will load
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\coffee-script,
npm WARN unmet dependency which is version 1.8.0
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\cson\node_modules\js2coffee requires co
ffee-script@'~1.7.1' but will load
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\coffee-script,
npm WARN unmet dependency which is version 1.8.0
npm install (for test)
npm install (for docpad tests)
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\cson requires coffee-script@'~1.7.1' bu
t will load
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\coffee-script,
npm WARN unmet dependency which is version 1.8.0
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\cson\node_modules\js2coffee requires co
ffee-script@'~1.7.1' but will load
npm WARN unmet dependency c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\coffee-script,
npm WARN unmet dependency which is version 1.8.0
coffee compile
npm test

> [email protected] test c:\Users\IBM_ADMIN\docpad-plugin-partials
> node ./out/partials.test.js

partials
partials > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
  at c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\out\lib\docpad.js:4107:17
  at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
partials > create OK
partials > load plugin partials
partials > load plugin partials OK
partials > generate
partials > generate > action
partials > generate > action OK
partials > generate > results
partials > generate > results > same files
partials > generate > results > same files OK
partials > generate > results > same file content for: partials.html

actual:
<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- WITHOUT template data -->
<header>Hello World. Site date is defined no</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- WITHOUT template data and custom name -->
<header>Hello Partials!. Site date is defined no</header>

<!-- with template data via fuzzy -->
<header>Hello World. Site date is defined yes</header>

<!-- footer -->
<footer>Goodbye!</footer>

<!-- empty -->


<!-- With a partial containing the same partial -->
<header>Hello <header>Hello World. Site date is defined no</header>. Site date is defined no</header>

expected:
<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- with template data -->
<header>Hello World. Site date is defined yes</header>

<!-- WITHOUT template data -->
<header>Hello World. Site date is defined no</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- with template data and custom name -->
<header>Hello Partials!. Site date is defined yes</header>

<!-- WITHOUT template data and custom name -->
<header>Hello Partials!. Site date is defined no</header>

<!-- with template data via fuzzy -->
<header>Hello World. Site date is defined yes</header>

<!-- footer -->
<footer>Goodbye!</footer>

<!-- empty -->


<!-- With a partial containing the same partial -->
<header>Hello <header>Hello World. Site date is defined no</header>. Site date is defined no</header>

partials > generate > results > same file content for: partials.html ERR!
partials > generate > results ERR!
partials > generate ERR!
partials ERR!

FAILURE: 4/5 tests ran successfully; 1 failed, 0 incomplete, 1 errors

Error #1:
partials > generate > results > same file content for: partials.html
AssertionError: expected '<!-- with template data -->\n<header>Hello World. Site date is defined yes</header>\n\n<!-- with template data -->
\n<header>Hello World. Site date is defined yes</header>\n\n<!-- with template data -->\n<header>Hello World. Site date is defined yes</head
er>\n\n<!-- WITHOUT template data -->\n<header>Hello World. Site date is defined no</header>\n\n<!-- with template data and custom name -->\
n<header>Hello Partials!. Site date is defined yes</header>\n\n<!-- with template data and custom name -->\n<header>Hello Partials!. Site da
te is defined yes</header>\n\n<!-- with template data and custom name -->\n<header>Hello Partials!. Site date is defined yes</header>\n\n<!-
- WITHOUT template data and custom name -->\n<header>Hello Partials!. Site date is defined no</header>\n\n<!-- with template data via fuzzy
-->\n<header>Hello World. Site date is defined yes</header>\n\n<!-- footer -->\n<footer>Goodbye!</footer>\n\n<!-- empty -->\n\n\n<!-- With a
 partial containing the same partial -->\n<header>Hello <header>Hello World. Site date is defined no</header>. Site date is defined no</head
er>' to deeply equal '<!-- with template data -->\r\n<header>Hello World. Site date is defined yes</header>\r\n\r\n<!-- with template data -
->\r\n<header>Hello World. Site date is defined yes</header>\r\n\r\n<!-- with template data -->\r\n<header>Hello World. Site date is defined
 yes</header>\r\n\r\n<!-- WITHOUT template data -->\r\n<header>Hello World. Site date is defined no</header>\r\n\r\n<!-- with template data
and custom name -->\r\n<header>Hello Partials!. Site date is defined yes</header>\r\n\r\n<!-- with template data and custom name -->\r\n<hea
der>Hello Partials!. Site date is defined yes</header>\r\n\r\n<!-- with template data and custom name -->\r\n<header>Hello Partials!. Site d
ate is defined yes</header>\r\n\r\n<!-- WITHOUT template data and custom name -->\r\n<header>Hello Partials!. Site date is defined no</heade
r>\r\n\r\n<!-- with template data via fuzzy -->\r\n<header>Hello World. Site date is defined yes</header>\r\n\r\n<!-- footer -->\r\n<footer>
Goodbye!</footer>\r\n\r\n<!-- empty -->\r\n\r\n\r\n<!-- With a partial containing the same partial -->\r\n<header>Hello <header>Hello World.
 Site date is defined no</header>. Site date is defined no</header>'
  at EventEmitterGrouped.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\out\lib\testers.js:268:46)
  at ambi (c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:57:27)
  at fire (c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:384:27)
  at b (domain.js:183:18)
  at Domain.run (domain.js:123:23)
  at EventEmitterGrouped.Task.fire (c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.j
s:398:25)
  at Object._onImmediate (c:\Users\IBM_ADMIN\docpad-plugin-partials\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:414:26)
  at processImmediate [as _immediateCallback] (timers.js:345:15)


npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

c:\Users\IBM_ADMIN\docpad-plugin-partials\Cakefile:99
      throw err;
            ^
Error: Process exited with error status code
  at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-partials\Cakefile:88:15)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:756:16)
  at Process.ChildProcess._handle.onexit (child_process.js:823:5)

set defaultPartialsPath in docpad config

I think it would be wonderful, if there would be an option, to set the default path for partials in the config file. I'm planing to deal with lots of docpad sites for customers, and I'd like put my partials to a globally accessible folder on my server, so more projects can access it, without touching this plugin's source.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.