{"id":15016634,"url":"https://github.com/dgrammatiko/11ty-to-codepen","last_synced_at":"2025-07-09T17:09:24.544Z","repository":{"id":57092812,"uuid":"273062662","full_name":"dgrammatiko/11ty-to-codepen","owner":"dgrammatiko","description":"Dead simple shortcode for automatically generated Codepen examples","archived":false,"fork":false,"pushed_at":"2020-07-04T10:54:37.000Z","size":8,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T06:50:28.205Z","etag":null,"topics":["eleventy","eleventy-plugin"],"latest_commit_sha":null,"homepage":"https://dgrammatiko.online/blog/11ty-to-codepen-shortcode/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgrammatiko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-17T19:35:55.000Z","updated_at":"2022-08-16T23:27:17.000Z","dependencies_parsed_at":"2022-08-22T21:40:42.795Z","dependency_job_id":null,"html_url":"https://github.com/dgrammatiko/11ty-to-codepen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dgrammatiko/11ty-to-codepen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrammatiko%2F11ty-to-codepen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrammatiko%2F11ty-to-codepen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrammatiko%2F11ty-to-codepen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrammatiko%2F11ty-to-codepen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgrammatiko","download_url":"https://codeload.github.com/dgrammatiko/11ty-to-codepen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgrammatiko%2F11ty-to-codepen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502181,"owners_count":23618558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eleventy","eleventy-plugin"],"created_at":"2024-09-24T19:49:10.153Z","updated_at":"2025-07-09T17:09:24.458Z","avatar_url":"https://github.com/dgrammatiko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 11ty-to-codepen\n\n## A simple 11ty shortcode for automagically creating pens on codepen!\n\n### Prerequisites\n\nThere is only one hard requirement (assuming that eleventy is already in place) and that is to allow html in the markdown files.\nEleventy defaults to `html: false` which is also the default for the markdown-it Library.\n\n- Make sure to enable it in your configuration!\n- Eg:\n\n```js\n/* Markdown Overrides */\nlet markdownLibrary = markdownIt({\n  html: true,\n  breaks: true,\n  linkify: true,\n});\neleventyConfig.setLibrary(\"md\", markdownLibrary);\n```\n\n### Installation\n\nInstallation should follow the usual NODE dance:\n\n```bash\nnpm i -D 11ty-to-codepen\n```\n\n### Usage\n\nFirst configure your .eleventy.js:\n\n- Import it:\n\n```js\n// At the top of the file add:\nconst codepenIt = require(\"11ty-to-codepen\");\n\n// Somewhere before the final return add:\neleventyConfig.addPairedShortcode(\"codepen\", codepenIt);\n```\n\n- Use it in any `.md` file:\n\n````md\n{% codepen \"https://unpkg.com/bonsai.css@latest/dist/bonsai.min.css\", \"https://unpkg.com/uhtml\", \"Heyyy\", \"Waz uuuuuuuup\", \"Test it\" %}\n\nSome very important code:\n\n```html\n\u003ch1 class=\"someClass\"\u003eTest\u003c/h1\u003e\n```\n\n```css\nbody {\n  --mx: 4rem;\n}\n```\n\n```js\nvar foo = function (bar) {\n  return bar * 2;\n};\n\nconsole.log(foo(5));\n```\n\n{% endcodepen %}\n````\n\n### Shortcode attributes:\n\n```md\ncodepen -\u003e The shortcode (1st attr)\n\n\"https://unpkg.com/bonsai.css@latest/dist/bonsai.min.css\", -\u003e Any ext css (semicolon seperated) (2nd attr)\n\n\"https://unpkg.com/uhtml\", -\u003e Any ext js (semicolon seperated) (3rd attr)\n\n\"Heyyy\", -\u003e Title of the pen (4th attr)\n\n\"Waz uuuuuuuup\", -\u003e Description of the pen (5th attr)\n\n\"Test it\" -\u003e Button text (for i18n) (6th attr)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgrammatiko%2F11ty-to-codepen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgrammatiko%2F11ty-to-codepen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgrammatiko%2F11ty-to-codepen/lists"}