GithubHelp home page GithubHelp logo

ykankaya / nuxt-netlify-cms-module Goto Github PK

View Code? Open in Web Editor NEW

This project forked from medfreeman/nuxt-netlify-cms-module

0.0 1.0 0.0 747 KB

Easy Netlify CMS integration with nuxt.js

License: MIT License

JavaScript 94.57% Vue 4.17% HTML 1.26%

nuxt-netlify-cms-module's Introduction

nuxt-netlify-cms-module

npm version npm Build Status Codecov Greenkeeper badge Dependencies devDependencies

styled with prettier

Easy Netlify CMS integration with nuxt.js

📖 Release Notes

Features

Setup

  • Add nuxt-netlify-cms and netlify-cms devDependencies using yarn or npm to your project

    npm i -D nuxt-netlify-cms netlify-cms OR yarn add -D nuxt-netlify-cms netlify-cms

  • Add nuxt-netlify-cms to modules section of nuxt.config.js

{
  modules: [
    // Simple usage
    "nuxt-netlify-cms",

    // With options
    ["nuxt-netlify-cms", { adminPath: "secure" }],
  ],

  // You can optionally use global options instead of inline form
  netlifyCms: {
    adminPath: "secure"
  }
}

Usage

Netlify CMS module config folder

This module will look for the Netlify CMS config file and extensions in the following folder: [nuxt.js srcDir]/netlify-cms.

ℹī¸ The nuxt.js srcDir is set to the project root folder by default. If you don't change this value in nuxt config, you'll just have to create the "netlify-cms" directory at your project root folder.

ℹī¸ If you don't use any of the following two features, there's no need to create this folder.

Netlify CMS config.yml

You can specify a custom configuration, that will be parsed and merged with the module's netlify CMS options.

You have to place the file in your Netlify CMS module config folder and name it config.yml.

ℹī¸ Note that each path in the file (media_folder, collections folder fields and collections file fields) will be rewritten to prepend nuxt.js srcDir, so please specify each path relative to this folder.

This file can be changed while nuxt dev is running, and Netlify CMS will be updated automatically.

Netlify CMS extensions

This module will look for Netlify CMS extensions in *.js files contained in Netlify CMS module config folder and subfolders, and include them in the CMS build.

These are of two kinds, Custom Previews and Widgets.

ℹī¸ The global variable CMS is available to these javascript files to reference the CMS object.

ℹī¸ The contents of this directory and subdirectories can be changed while nuxt dev is running, and Netlify CMS will be updated automatically.

Options

You can pass options using module options or netlifyCms section in nuxt.config.js.

adminPath

  • Default: "admin"

adminPath defines the path where Netlify CMS will be served.

With nuxt default configuration, it will be served to http://localhost:3000/admin/ in development.

adminTitle

  • Default: "Content Manager"

adminTitle defines the html title of the page where Netlify CMS will be served.

cmsConfig

  • Default: { media_folder: "static/uploads" }

cmsConfig wholly reflects Netlify CMS config.yml, in js object format.

ℹī¸ The order of precedence for the cms configuration is defaults < netlify-cms.yml < module options

ℹī¸ The paths are also rewritten according to nuxt.js srcDir

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ yarn test).

License

MIT License

Copyright (c) Mehdi Lahlou [email protected]

nuxt-netlify-cms-module's People

Contributors

medfreeman avatar greenkeeper[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.