assemble-plugin-functions

0.0.3 • Public • Published

assemble-plugin-functions NPM version Build Status 依赖模块状态

Assemble的功能函数集合.

Table of Contents

Quickstart

包安装:

npm install assemble-plugin-functions --save

Gruntfile.js定制:

module.exports = function(grunt) {
 
  // Project configuration.
  grunt.initConfig({
    assemble: {
      options: {
        plugins: ['assemble-plugin-functions']
      },
      ...
    }
  });
  grunt.loadNpmTasks('assemble');
  grunt.registerTask('default', ['assemble']);
};

Options

addAttributeDate

Type: json

增加属性,类型json,选择器和值

这个是增加属性,原有属性会好留

removeAttributeDate

Type: json

移除属性,类型json,选择器和值

这个是移除属性,在原有属性上移除部分

replaceAttributeDate

Type: json

替换属性,类型json,选择器和值

这个是移除属性,在原有属性上移除部分

Usage Examples

基本用法

最基本用法:

assemble: {
  blog: {
    options: {
      plugins: ['assemble-plugin-functions'],
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}
 

高级

assemble: {
  blog: {
    options: {
      plugins: ['assemble-plugin-functions'],
      functions: {
         removeAttributeData: {
              "p": {
                  "pclass": " nohas"
              },
              "h1,h2,h3,h4": {
                  "id": "all"
              },
              "a": {
                  'atest1':"all"
              }
          },
        replaceAttributeData: {
            "p": {
                "pclass": "hello-pclass"
            },
            "h1,h2,h3,h4": {
                'id':"hello-id"
            }
        }
      }
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

Author

GoldCome

Release History

  • 2014-02-24   v0.0.0   功能函数插件第一次构建
  • 2014-02-24   v0.0.1   readme文档错误重新发布
  • 2014-03-09   v0.0.2   发布到github
  • 2014-03-13   v0.0.3   修正各个细节,正式发布

License

Copyright (c) 2014 goldcome, contributors. Released under the MIT license


This file was generated on Saturday, March 15, 2014.

Package Sidebar

Install

npm i assemble-plugin-functions

Weekly Downloads

3

Version

0.0.3

License

none

Last publish

Collaborators

  • goldcome