npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eleventy-vue-shortcodes

v0.1.0

Published

Compile-time Vue SFC shortcodes for Eleventy - use Vue components in markdown without client-side JavaScript

Readme

eleventy-vue-shortcodes

Compile-time Vue SFC shortcodes for Eleventy - use Vue components in markdown without client-side JavaScript.

Features

  • 🚀 Zero Runtime: Vue components are compiled at build time - no client-side JavaScript needed
  • 📝 Markdown Ready: Use Vue components directly in your markdown files as shortcodes
  • 🎨 Scoped CSS: Automatic CSS scoping prevents style conflicts
  • Fast: No hydration overhead, pure static HTML output
  • 🔧 Simple Setup: Auto-registers all Vue components as Eleventy shortcodes
  • 🎯 Flexible Props: Pass data to components via shortcode parameters

Installation

npm install eleventy-vue-shortcodes

Quick Start

  1. Configure Eleventy (in eleventy.config.js or .eleventy.js):
import { VueShortcodes } from 'eleventy-vue-shortcodes';

export default function(eleventyConfig) {
  // Register the plugin
  eleventyConfig.addPlugin(VueShortcodes, {
    componentsDir: '_includes/components',  // Where your Vue components live
    scopedCSS: true,                        // Enable automatic CSS scoping
    verbose: false                          // Set to true for debug output
  });
}
  1. Create a Vue Component (_includes/components/WelcomeBox.vue):
<template>
  <div class="welcome-box">
    <h2>{{ greeting }}</h2>
    <p>{{ message }}</p>
    <button @click="increment">Clicked {{ count }} times</button>
  </div>
</template>

<script setup>
import { ref } from 'vue';

defineProps({
  greeting: {
    type: String,
    default: 'Hello from Vue!'
  },
  message: {
    type: String, 
    default: 'This is a Vue component in your markdown!'
  }
});

const count = ref(0);
const increment = () => count.value++;
</script>

<style scoped>
.welcome-box {
  border: 2px solid #42b883;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.welcome-box h2 {
  color: #42b883;
  margin-top: 0;
}

button {
  background: #42b883;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}
</style>
  1. Use in Markdown (index.md):
# My Page

Here's a Vue component in markdown:

{% WelcomeBox "Custom Greeting!", "This message was passed as a prop!" %}

Regular markdown content continues here...

Configuration Options

eleventyConfig.addPlugin(VueShortcodes, {
  // Directory containing Vue components (relative to Eleventy input dir)
  componentsDir: '_includes/components',
  
  // Enable automatic CSS scoping
  scopedCSS: true,
  
  // Auto-register components as shortcodes
  autoRegister: true,
  
  // Optional prefix for shortcode names
  prefix: '', // e.g., 'vue-' would create 'vue-WelcomeBox'
  
  // File extensions to process
  extensions: ['.vue'],
  
  // Enable debug logging
  verbose: false
});

How It Works

  1. Build Time Processing: Vue components are parsed and processed during Eleventy's build phase
  2. Template Compilation: Vue templates are converted to static HTML with prop interpolation
  3. CSS Scoping: Styles are automatically scoped with unique class names to prevent conflicts
  4. Shortcode Registration: Each Vue component becomes an Eleventy shortcode you can use in templates
  5. Static Output: Final HTML contains no Vue runtime - just pure, fast-loading HTML and CSS

Prop Handling

Currently supports simple prop passing via shortcode parameters:

{% ComponentName "firstProp", "secondProp" %}

Props are mapped in order to your component's defineProps() definition.

Examples

See the examples/basic-usage/ directory for a complete working example.

Requirements

  • Node.js >= 18.0.0
  • Eleventy >= 3.0.0

License

MIT

Contributing

Issues and pull requests welcome! This is an early-stage project with room for enhancement.

Roadmap

  • [ ] Named parameter support ({% Component prop="value" %})
  • [ ] Slot content support
  • [ ] Advanced template features (v-if, v-for handling)
  • [ ] TypeScript support
  • [ ] More comprehensive test suite