parcel-transformer-hydejs
v1.0.0
Published
A Parcel 2 transformer for HydeJS, a Jekyll-like static site generator engine. It processes Liquid templates with front matter, collections, and global data.
Maintainers
Readme
parcel-transformer-hydejs
A Parcel 2 transformer for HydeJS, a Jekyll-like static site generator engine. It processes Liquid templates with front matter, collections, and global data. This transformer brings the power and conventions of Jekyll into the modern, fast Parcel ecosystem.
Installation
Install the package using npm or yarn:
npm install --save-dev parcel-transformer-hydejsor
yarn add --dev parcel-transformer-hydejsUsage
To use this transformer, you need to configure it in your .parcelrc file. This tells
Parcel to run parcel-transformer-hydejs on any file with a .liquid, .md, or
.html extension.
.parcelrc
{
"extends": "@parcel/config-default",
"transformers": {
"*.{liquid,md,html}": ["parcel-transformer-hydejs", "..."]
}
}Features
This transformer is the core engine that provides Jekyll-like functionality within Parcel.
- Jekyll-like Data Cascade: Merges data from global configuration (
config.json), layouts, and page front matter. - Collections: Processes entire directories (like
_posts), sorts them, and makes them available as data collections (e.g.,site.posts). - Page Object Model: Creates a rich
pageobject for each file, with computed properties likeurl,date,excerpt, andnext/previouslinks for pagination. - Liquid Templating: Renders content using LiquidJS.
- Front Matter: Parses YAML front matter from any file.
Configuration
This transformer is designed to work with a config.json file in your project root,
similar to Jekyll's _config.yml. It will automatically load and use this configuration
to build your site data. You can see configDefaults.json for all available options.
License
MIT
