Skip to content

hypebeast/spike-directus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spike-directus

Build Status

Spike plugin for integrating Directus CMS with a static site.

NOTE: This plugin is in a early development. Use it on your own risk.

Why should you care?

If you are using the Directus CMS and want to pull your API values in and compile them into a spike static site, this plugin will do some good work for you.

Installation

npm install spike-directus -S

Usage

// app.js
const Directus = require('spike-directus')
const htmlStandards = require('reshape-standard')
const DIRECTUS_API = process.env.DIRECTUS_API
const DIRECTUS_TOKEN = process.env.DIRECTUS_TOKEN
const locals = {}

module.exports = {
  plugins: [
    new Directus({
      addDataTo: locals,
      url: DIRECTUS_API,
      apiToken: DIRECTUS_TOKEN,
      contentTypes: [{
        name: 'knifes',
        template: {
          path: 'templates/item.html',
          output: (item) => { return `knifes/${item.slug}.html` }
        }
      }]
    })
  ],
  reshape: htmlStandards({ locals: () => locals })
}

Note: Unfortunately, there is no more documentation at the current time. See spike-rooftop for more information. This plugin supports the same config options as spike-rooftop and behaves in the same way.

About

Spike plugin for integrating Directus CMS with a static site

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published