Catalog npm
PACKAGE EXPLORERView in registry

11ty-to-codepen

npm

A simple 11ty shortcode for automagically created pens on codepen!

11tycodepeneleventyexampleshortcode
Versions collected3
Direct dependencies0From release 1.0.2
Last observed20 Oct, 18:06 UTC

README

Current package documentation

11ty-to-codepen

A simple 11ty shortcode for automagically creating pens on codepen!

Prerequisites

There is only one hard requirement (assuming that eleventy is already in place) and that is to allow html in the markdown files. Eleventy defaults to html: false which is also the default for the markdown-it Library.

  • Make sure to enable it in your configuration!
  • Eg:
/* Markdown Overrides */
let markdownLibrary = markdownIt({
  html: true,
  breaks: true,
  linkify: true,
});
eleventyConfig.setLibrary("md", markdownLibrary);

Installation

Installation should follow the usual NODE dance:

npm i -D 11ty-to-codepen

Usage

First configure your .eleventy.js:

  • Import it:
// At the top of the file add:
const codepenIt = require("11ty-to-codepen");

// Somewhere before the final return add:
eleventyConfig.addPairedShortcode("codepen", codepenIt);
  • Use it in any .md file:
{% codepen "https://unpkg.com/bonsai.css@latest/dist/bonsai.min.css", "https://unpkg.com/uhtml", "Heyyy", "Waz uuuuuuuup", "Test it" %}

Some very important code:

```html
<h1 class="someClass">Test</h1>
```

```css
body {
  --mx: 4rem;
}
```

```js
var foo = function (bar) {
  return bar * 2;
};

console.log(foo(5));
```

{% endcodepen %}

Shortcode attributes:

codepen -> The shortcode (1st attr)

"https://unpkg.com/bonsai.css@latest/dist/bonsai.min.css", -> Any ext css (semicolon seperated) (2nd attr)

"https://unpkg.com/uhtml", -> Any ext js (semicolon seperated) (3rd attr)

"Heyyy", -> Title of the pen (4th attr)

"Waz uuuuuuuup", -> Description of the pen (5th attr)

"Test it" -> Button text (for i18n) (6th attr)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.2Registry latest23 Jun 20200
1.0.117 Jun 20200
1.0.017 Jun 20200

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
dgrammatiko/11ty-to-codepen

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:06 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:56ccdb9f62f6cd037fcaf6938d1ca9f88dbcfdc2a161e4c786594143ccb1eca6