
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Simple static
siteblog generator
$ npm install -g gener
cd
to the folder where you want the dist files to be created, and run:
$ gener
This will create an index.html
and bundle.js
file, that is your blog, congratulations :tada:. Add those files to a static server and you are done.
Now for this to work, you need a posts
folder, containing, at least, one post. A post is made of two files, a markdwon file and a json file, both with the same name.
The md
file is the actual content of your post, in markdown format. The json file is a configuration file, you can add the next properties to that files:
There are two things that can be customized: Global config, through config.js
file, and layouts through layouts
folder.
In the root directory, you can add a config.json
file. You can customize the following options:
default
layout, if you change that, you should add layouts files to the layouts
folder.index.html
file.index.html
file, they are runned after the view is mounted, otherwise, you wouldn't have access to the DOM of your blog.To customize layouts, add a layouts
folder in the root directory. The folder contains the custom layouts that you want to add, those layouts are Handlebar files, with the name that you defined previously in your config.json
file.
If there is a layout folder and no layout
property in your config file, the layouts templates would be ignored.
Currently, there is two supported layouts, one for the list of posts and one for each post, and they should be named <layout-name>.hbs
and <layout-name>-post.hbs
.
For example, if you have a config file like this:
{
"name": "Some blog",
"layout": "awesome"
}
You should have two layout files: layouts/awesome.hbs
and layouts/awesome-post.hbs
. Also, keep in mind that the post layout have access to each post config property and to a content
property, with the html of your post, so you must use triple braces, and the main layout have access to the properties of the global config file and a posts
property which is an array with the posts info.
MIT © Yerko Palma.
FAQs
Simple static site generator
The npm package gener receives a total of 49 weekly downloads. As such, gener popularity was classified as not popular.
We found that gener 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.