@robert.tools/eleventy-shortcodes-script-style
v1.0.0
Published
A collections of shortcodes to include a script and style tag.
Maintainers
Readme
🗂️ @robert.tools/eleventy-shortcodes-script-style
A collections of shortcodes to include a script and style tag.
📜 Usage
🟢 Installation
npm install @robert.tools/eleventy-shortcodes-script-style📝 Sample usage
import { viteScriptTag } from '@robert.tools/eleventy-shortcodes-script-style';📜 Usage
eleventyConfig.addNunjucksShortcode('scriptTag', viteScriptTag);You can use the following functions:
viteScriptTag(entryFile, pathPrefix)- Generates a script tag for the given entry file and path prefix.viteLegacyScriptTag(entryFile, pathPrefix)- Generates a legacy script tag for the given entry file and path prefix.viteLinkStylesheetTags(entryFile, pathPrefix)- Generates link tags for the CSS files associated with the given entry file and path prefix.
{% scriptTag entryFile, pathPrefix %}entryFile- The entry file for the script tag.pathPrefix- The path prefix to prepend to the script file.
🗃️ commands
After an npm install with npm i the following commands are available:
- initialize placeholders:
npm run init <semantic> - release a new version:
npm run release <semantic>
⚖️ Notes
This software is hand-crafted, test-driven and assisted by AI tools. I know each line of my code. ✌️
| Tool | Comment | | ------------- | ------------- | | | Test-driven development with Jest | | | Part of the robert.tools ecosystem | | | Code completion | | | chatGPT research |
