What are the differences between all those paths in DocPad's document metadata?
Each document have a set of metadata with a lot of different kinds of paths and filenames, here is an example list:
fullPath: '/Users/kizu/Projects/docpad-test/src/documents/pages/page2_en/index.html.md',
relativePath: 'pages/page2_en/index.html.md',
basename: 'index',
outBasename: 'index',
filename: 'index.html.md',
fullDirPath: '/Users/kizu/Projects/docpad-test/src/documents/pages/page2_en',
outPath: '/Users/kizu/Projects/docpad-test/out/en/pages/page2/index.html',
outDirPath: '/Users/kizu/Projects/docpad-test/out/pages/page2_en',
outFilename: 'index.html',
relativeOutPath: 'en/pages/page2/index.html',
relativeDirPath: 'pages/page2_en',
relativeOutDirPath: 'en/pages/page2_en',
relativeBase: 'pages/page2_en/index',
relativeOutBase: 'pages/page2_en/index',
name: 'index.html',
slug: 'pages-page2-en-index',
url: '/en/pages/page2/index.html',
urls: [ '/en/pages/page2/index.html' ],
I know the purpose for only two of those metadatas:
outPath
sets the output path in the file system, so by changing it onrenderBefore
event would change the output path and the filename.url
is the absolute url from the root of the site, it is mostly used for linking to other documents.
But what are the purposes for all other paths and names? Are there plugins that use them, or code features of DocPad that rely on these?
The context of the question is similar to the answers to this one: I want to rewrite the output paths and filenames of my documents, so I need to know what metadata I need to change. Right now I change only the outPath
and url
, but is it enought? Or maybe there is a way to change the output path using just one magic method, so it would change all those paths to the proper new ones automatically, so I won't need to bother about this at all?