Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@binyamin/eleventy-preact

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@binyamin/eleventy-preact

An Eleventy plugin for rendering JSX/TSX as HTML, with Preact

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@binyamin/eleventy-preact

A personal Eleventy plugin for rendering JSX/TSX as HTML, with Preact.

Usage

Add the plugin to your eleventy config, like so:

const eleventyPreact = require("@binyamin/eleventy-preact");

module.exports = function(eleventyConfig) {
    eleventyConfig.addPlugin(eleventyPreact, {
        /* options */
    });
}

Customization

  • doctype (boolean) - Determines whether to add a doctype (<!DOCTYPE HTML>) before the rendered HTML. The doctype is never applied to JSX rendered via the shortcode.
  • shortcode (string or false) - This will register a shortcode with the given name, which renders a JSX file in-place. Setting it to false disables the shortcode. The shortcode takes two parameters. The first is a file path, relative to the includes directory. The second is an object, passed as props.

These are the default options:

{
    doctype: true,
    shortcode: "render_jsx"
}

Contributing

All input is welcome; feel free to open an issue. Please remember to be a mensch. If you want to program, you can browse the issue list.

All source-code is provided under the terms of the MIT license. Copyright 2022 Binyamin Aron Green.

Keywords

FAQs

Package last updated on 31 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc