Skip to content

jamshop/eleventy-plugin-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Eleventy Plugin - Forms

Generate forms from frontmatter.

No npm installation yet as I'd like to add more features before v1.

Usage

In you main config .eleventy.js:

const pluginForm = require("./eleventy-plugin-forms");

module.exports = (eleventyConfig) => {
  eleventyConfig.addPlugin(pluginForm);
  // and the rest of your config
};

In your template:

---
layout: "page.njk"
fields: 
  -
    handle: name
    field:
      display: Name
      type: text
      required: true
  -
    handle: agree
    field:
      display: Do you agree?
      type: radio
      options: 
        yes: Yes
        no: No        
---
{% form fields %}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published