0.0.3 • Published 9 months ago

astro-hyperscript v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

astro-hyperscript

This Astro integration adds Hyperscript.org to your project so that you can use Hyperscript.org anywhere on your page.

Installation

Manual Install

First, install the astro-hyperscript package using your package manager. If you're using npm or aren't sure, run this in the terminal:

npm install astro-hyperscript hyperscript.org

Then, apply this integration to your astro.config.* file using the integrations property:

  // astro.config.mjs
  import { defineConfig } from 'astro/config';
+ import hyperscript from 'astro-hyperscript';

  export default defineConfig({
    // ...
    integrations: [hyperscript()],
    //             ^^^^^^^^
  });

Usage

Once the integration is installed, you can use hyperscript.org directives and syntax inside any Astro component. The Hyperscript.org script is automatically added and enabled on every page of your website.

Check Astro Integration Documentation for more on integrations.

Limitations

The Hyperscript.org integration does not give you control over how the script is loaded or initialized. If you require this control, consider installing and using hyperscript.org manually. Astro supports all officially documented hyperscript.org manual setup instructions, using <script> tags inside of an Astro component.

---
// src/pages/index.astro
---

<!-- Example: Load hyperscript on a single page. -->
<script>
  import "hyperscript.org";
</script>

Configuration

The hyperscript.org integration does not support any custom configuration at this time.

Examples

Contributing

This package is maintained by adamNewell. You're welcome to submit an issue or PR!