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

@orchidjs/eleventy-plugin-ids

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orchidjs/eleventy-plugin-ids

@11ty plugin for adding ids to html headings and other elements

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eleventy-plugin-ids

@11ty plugin for adding ids to html headings and other elements

<h1>Foo Bar</h1>

will become

<h1 id="foo-bar">Foo Bar</h1>

Installation

npm install @orchidjs/eleventy-plugin-ids

Basic Usage

Add eleventy-plugin-ids to your .eleventy.js file

module.exports = function(eleventyConfig) {
	//...
	
	const anchors_plugin = require('@orchidjs/eleventy-plugin-ids');
	eleventyConfig.addPlugin(anchors_plugin);
	
	//...
}

Settings

module.exports = function(eleventyConfig) {
	//...
	
	const anchors_plugin = require('@orchidjs/eleventy-plugin-ids');
	eleventyConfig.addPlugin(anchors_plugin,{
		selectors: ['h1','h2','h3','h4','h5','h6'],
		prefix: 'custom-id-prefix-',
		formatter: function(element,existing_ids_array){
			return '--generate-a-custom-id-here-',
		}
	});
	
	//...
}

Keywords

FAQs

Package last updated on 23 Nov 2021

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