
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Blake can be used from the command-line or as library.
npm install -g blake
blake path/to/input path/to/output [path/to/input/file …]
The first parameter is the path to your input directory.
The second parameter is the path to your output directory. Please be warned that this directory is removed everytime a full generation of your site starts. You better not point it at your home directory—Blake doesn't provide safety net. If the output directory doesn't exist, Blake makes it.
blake input output
The optional third parameter is a list of filenames. While writing, you often times just want to quickly preview the page you're currently working on, thus you don't necessarily want to render your whole site. Let's say you're tweaking your about page and want to see it in the browser.
blake input output input/about.md
Or you may just want to compile your home and archive pages.
blake input output input/home.md input/archive.md
When Blake starts it requires a configuration module, which it expects to find at input/view/config.js. The configuration defines the conventions for accessing input data and exports a map of bake functions. In my opinion it makes sense to use template names as identifiers. Each of your views has to implement a bake function.
# This module covers configuration.
# Path conventions to use for input data.
exports.paths =
data: '/data',
templates: '/templates/',
resources: '/resources/',
posts: '/data/posts'
# Export map with bake functions by template names.
exports.bakeFunctions =
'rss.jade': require('./rss.js').bake,
'article.jade': require('./article.js').bake,
'home.jade': require('./home.js').bake,
'about.jade': require('./about.js').bake,
'archive.jade': require('./archive.js').bake
Of course you can always build your site locally and upload it to your webserver manually, but I recommend to run Blake on your server and use post-receive hooks to automatically generate your site on your server everytime you're pushing to your input data repository.
See LICENSE.
FAQs
Generate anything
The npm package blake receives a total of 29 weekly downloads. As such, blake popularity was classified as not popular.
We found that blake 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.