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

@droyer/nuxtcms

v0.8.20

Published

CMS for Nuxt.js

Downloads

50

Readme

:package: NuxtCMS

NuxtCMS Logo

npm version npm downloads Circle CI Codecov Dependencies Standard JS

Nuxt.js module for managing your projects data and content.

NuxtCMS Demo

Github Repo | Live Site

NuxtCMS Logo

📖 Release Notes

:heavy_check_mark: Features

  • :memo: Write content in Markdown

  • :card_file_box: Use YAML for data

  • :lock: Can set content collection items to draft

  • :mag: Easy access to get the content and data you need

  • :label: Automatic tag API creation for any collections that include them in frontmatter

:zap: The Quick Overview

  1. :ballot_box_with_check: Everything lives in the _CMS directory
  2. Two Directories for storing files
    • Content for Markdown collections
    • Data for Yaml collections and individual files
  3. Everything can be accessed as JSON via the $cmsApi.get() method

Example Directory Structure

# INSIDE NUXT SOUCE DIRECTORY

_CMS
├── Content
│   ├── Blog
│   ├── Markdown
│   └── Pages
└── Data
    ├── Courses
    └── Projects
    ├── menu.yml
    └── settings.yml
  • Markdown files go inside subdirectories within Content

  • Directory name of Blog is NOT customizable

  • YAML files go inside within Data as files or inside subdirectories

  • Subdirectories inside Data are considered "DataCollections" This means they will a slug and title will automatically be provided for each item within the collection so they can be used for dynamic route generation

:page_facing_up: Using Your Content & Data

NuxtCMS provides a helper via $cmsApi that is available on the context and instance.

Whether you want all the items within a content type or a specific item, you use the same method, $cmsApi.get() to get both content and data. For example:

const allProjects = $cmsApi.get("projects");
const specificProject = $cmsApi.get("projects", params.slug);

Examples

In A Page Route

Getting All Items Within a Data or Content Collection

asyncData({ $cmsApi }) {
    const articles = $cmsApi.get('articles')
    return { articles }
}

In A Dynamic Page Route

Get An Item Within a Data or Content Collection

asyncData({ $cmsApi, params }) {
    const article = $cmsApi.get('articles', params.slug)
    return { article }
}

Within Vuex Store

nuxtServerInit({ commit }, { $cmsApi }) {
  commit('setDataFileExample', $cmsApi.get('data-file-example'))
}

Within A Component

computed: {
  nav() {
    return this.$cmsApi.get('nav-menu')
  }
}

Using Provided Blog Styles

<style src="@droyer/nuxtcms/lib/assets/blog-styles.css"></style>
<style src="prismjs/themes/prism-tomorrow.css"></style>

Setup

  1. Add nuxtcms dependency with yarn or npm into your project
  2. Add nuxtcms to modules section of nuxt.config.js
  3. Configure it:
{
  modules: [
    // Simple usage
    "@droyer/nuxtcms",

    // With options
    [
      "@droyer/nuxtcms",
      {
        /* module options */
      }
    ]
  ];
}

Options

The Options go here

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) David Royer [email protected]