سؤال

I need to separate the Docpad system from the actual content that gets rendered. The Docpad system is a Node module that gets npm installed inside the content project.

Here's the structure of content project:

content-project/
  - src/
    - documents/
    - files/
    - layout/
  - node_modules/
    - docpad-system/
      - node_modules/
        - docpad/
        - docpad-plugins-*/
      - docpad.js
      - package.json

Is this the proper way to structure this project so that the docpad system is separate from the content?

I'm not sure if the docpad config is on the right place. I tried setting the srcPath and rootPath but the contents doesn't render.

هل كانت مفيدة؟

المحلول

Not entirely sure what you are trying to achieve. But if you just want to change the location of the src and out folder then changing the srcPath and outPath in the docpad.coffee/js should be all you need to do. Like this:

// Out Path
// Where should we put our generated website files?
// If it is a relative path, it will have the resolved `rootPath` prepended to it
outPath: '../out',  // default out

// Src Path
// Where can we find our source website files?
// If it is a relative path, it will have the resolved `rootPath` prepended to it
srcPath: '../src',  // default src

This will force Docpad to look for the source files in the folder above the rootPath and also output the rendered files in the same place (and within the 'out' folder).

As a result you might have a project structure something like this:

content-project/
    docpad-system
    src
    out

docpad-system would contain all your node modules and docpad.coffee/js and package.json. This would be the root of your project as far as docpad was concerned and this is where you would want to run docpad from.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top