Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
bake is a mighty template engine for static text files. It is something like Tom Preston-Werner's jekyll, but is independent of file types and markup languages.
bake enables JavaScript templates for any type of text files. These templates may contain embedded JavaScript as a template language.
A template (default.tpl
) may look like this:
<!DOCTYPE html>
<html lang="<%= file.lang %>">
<head>
<meta charset="utf-8">
<title><%= file.title %> | <%= global.siteTitle %></title>
</head>
<body>
<h1><%= file.title %></h1>
<%= file.__content %>
<% if (file.helloWorld) { %>
<p>Hello world!</p>
<% } %>
</body>
</html>
And a corresponding content file (post.txt
) could look like this:
title: A sample file
lang: en
helloWorld: true
<p>Sample text.</p>
With a minimal configuration file (bake.json
)
{
"fileExtensions": {
"txt": "html" // look for html files and save as html file
},
"properties": {
"siteTitle": "My Site" // Global website title
}
}
the output (post.html
) would be:
<!DOCTYPE>
<html lang="en">
<head>
<meta charset="utf-8">
<title>A sample file | My Site</title>
</head>
<body>
<h1>A sample file</h1>
<p>Sample text.</p>
<p>Hello world!</p>
</body>
</html>
bake not only enables building websites (although that's its main purpose) but lets you choose. You can write hooks for each property to control the output.
Visit the Wiki for more information or look at the example.
bake is not a webserver. It doesn't replace your Apache/Nginx etc. So if you
want to write a website that is accessible by the public, you have to change the
settings of your webserver to use bakeDir
as the root directory.
bake is no blogging engine (although it's possible to create one with the help of bake). It doesn't provide generating an index or a feed. It doesn't have any commenting functionality either.
If you encounter any bugs or issues, feel free to open an issue at github.
This package is licensed under the MIT license.
This work was inspired by heimweh by Benjamin Birkenhake and txtracer by Konstantin Weiss, but also by wheat by Tim Caswell and jekyll by Tom Preston-Werner.
FAQs
static file bakery
The npm package bake receives a total of 26 weekly downloads. As such, bake popularity was classified as not popular.
We found that bake 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.