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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-website-plugins

v1.0.1

Published

This package aims at simplifying static site coding with vuejs. It helps VueJS developers coding static sites without the use of static site generators, in few steps. It also allows integrators to put in place static websites with simple html and css comp

Downloads

3

Readme

vue-website-plugins

This package aims at simplifying static site coding with vuejs. It helps VueJS developers coding static sites without the use of static site generators, in few steps. It also allows integrators to put in place static websites with simple html and css components, and then adding reactivity without use of jquery.

installation

npm i --save vue-website-template

how to use

follow a simple convention

Code your static pages in a _pages directory, your layouts in a _layouts directory and some includes such as header in a _includes directory, all under under src. These directories must exist.

The includes and layouts will simply automatically be registered as components, the pages tree will be used to generate the corresponding static pages.

To do that, simply follow the two others steps.

use vue plugin

In a VueJS/webpack project, in the main.js, use the plugin as follow :

import Vue from 'vue'
import router from './router'
import plugin from 'vue-website-plugins/vue'

Vue.use(plugin, {router})

Where router is your vue-router instance. No need to register your static pages over there, just register your special routes that do not correspond to the above convention.

use webpack plugin

In webpack.prod.conf.js first call

const PrerenderSpaPlugin = require('vue-website-plugins/webpack')

It's called PrerenderSpaPlugin because it's a simple overload of the prerender-spa-plugin. You can use it as is. Of course, here again, no need to specify any route corresponding to your static pages.

Lastly add the plugin as follow :

new PrerenderSpaPlugin(
  // Absolute path to compiled SPA
  path.join(__dirname, '../dist'),
  // List of routes to prerender
  []
)

simple exemple

-- src
 L _pages
  L index.vue
  L contact
   L index.vue
 L _includes
  L my-header.vue
 L _layouts
  L main-layout.vue

src/_pages/index.vue

<template>
  <main-layout>
    <div class="my-content">
      my content
    </div>
  </main-layout>
</template>

<style>
  .my-content {
    padding: 20px;
  }
</style>

src/_pages/contact/index.vue

<template>
  <main-layout>
    <div @click="sendIt">
      contact
    </div>
  </main-layout>
</template>
<script>
  export default {
    methods: {
      sendIt () {
        console.log('this sends a message')
      }
    }
  }
</script>

src/_layouts/main-layout

<template>
  <div>
    <my-header></my-header>
    <div>
      <slot></slot>
    </div>
  </div>
</template>

src/_includes/my-header

<template>
  <div>menu</div>
</template>

contributing

You can build the sources with npm run build locally and use it with npm link