GithubHelp home page GithubHelp logo

heavybeard / wp-file-header Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oleynikd/gulp-wp-file-header

0.0 2.0 1.0 21 KB

Gulp plugin that adds 'File Header' to Wordpress Theme's style.css file based on package.json

Home Page: https://www.npmjs.com/package/wp-file-header

License: MIT License

JavaScript 100.00%

wp-file-header's Introduction

wp-file-header

Node.js plugin that adds 'File Header' to Wordpress Theme's style.css file based on package.json data

For now works only with style.css file (supports only WP Themes, not plugins)

Installation

$ npm i wp-file-header --save-dev

Description

Creates this: style.css

/*
Theme Name:     Twenty Thirteen
Theme URI:      http://wordpress.org/themes/twentythirteen
Author:         the WordPress team
Author URI:     http://wordpress.org/
Description:    The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
Version:        1.0.0
License:        GNU General Public License v2 or later
License URI:    http://www.gnu.org/licenses/gpl-2.0.html
Tags:           black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Text Domain:    twentythirteen
Template:       twentytwelve
*/

From this: package.json

{
	"name": "twenty-thirteen",
	"version": "1.0.0",
	"author": "the WordPress team",
	"authoruri": "http://wordpress.org/",
	"homepage": "http://wordpress.org/themes/twentythirteen",
	"description": "The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.",
	"keywords": [
		"black",
		"brown",
		"orange",
		"tan",
		"white",
		"yellow",
		"light",
		"one-column",
		"two-columns",
		"right-sidebar",
		"flexible-width",
		"custom-header",
		"custom-menu",
		"editor-style",
		"featured-images",
		"microformats",
		"post-formats",
		"rtl-language-support",
		"sticky-post",
		"translation-ready"
	],
	"themename": "Twenty Thirteen",
	"textdomain": "twentythirteen",
	"license": "GNU General Public License v2 or later",
	"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
	"template": "twentytwelve"
}

Usage

Plain

var wp = require('wp-file-header')('./package.json');
wp.patch('./style.css', function(err){
	// done
});

or just

var wp = require('wp-file-header')();
wp.patch();

With Gulp:

var gulp = require('gulp'),
	wp   = require('wp-file-header')('./package.json');

gulp.task('wp', function () {
	wp.patch('./style.css', function(err){
		// done
	});
});

With Grunt:

module.exports = function(grunt) {
	var wp = require('wp-file-header')('./package.json');
	grunt.registerTask('wp', function() {
		var done = this.async();
		wp.patch('./style.css', function(err){
			done();
		});
	});
};

wp-file-header's People

Contributors

heavybeard avatar oleynikd avatar

Watchers

 avatar  avatar

Forkers

rcdlopez

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.