Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
docpad-plugin-datafiles
Advanced tools
DocPad plugin for loading json/yml/etc. and making it avaliable to documents and layouts. Forked from docpad-plugin-data with several improvements
DocPad plugin for simple data files.
Loads and parses JSON, YAML, JavaScript, and CoffeeScript files from src/data/
and stores the contents on
config.templateData
, which makes the data available as @filename
(or {{filename}}
or whatever) when rendering
documents and layouts.
Notable features:
file-name.json
becomes @fileName
.)docpad install datafiles
dataPaths: An array of folders to search for data files in.
Relative dataPaths
are resolved from docpadConfig.srcPath
, which defaults to ./src/
.
camelCase: converts file names with spaces, hyphens, etc. to camelCase to enable easier usage in templates.
For example foo-bar.json
becomes @fooBar
when true
vs @['foo-bar']
when false.
alwaysReload: Default behavior is to check the mtime
and only reload modified files during regeneration.
When true, this check will be skipped and all files will always be reloaded.
Note that DocPad only watches for changes in folders under docpadConfig.srcPath
.
Config with default options in CoffeeScript:
docpadConfig = {
plugins: {
datafiles:
dataPaths: [ 'data' ],
camelCase: true,
alwaysReload: false
}
# ...
}
module.exports = docpadConfig
Or JavaScript:
const docpadConfig = {
plugins: {
datafiles: {
dataPaths: ['data'],
camelCase: true
alwaysReload: false
}
}
// ...
};
module.exports = docpadConfig;
Original code was forked from docpad-plugin-data. Tests, documentation, various features, and other improvements by Nathan Friedly.
FAQs
DocPad plugin for loading json/yml/etc. and making it avaliable to documents and layouts. Forked from docpad-plugin-data with several improvements
The npm package docpad-plugin-datafiles receives a total of 4 weekly downloads. As such, docpad-plugin-datafiles popularity was classified as not popular.
We found that docpad-plugin-datafiles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.