Permalink
Browse files

feat(core): rebrand with new name `grunt-assets-inline`

  • Loading branch information...
sparanoid committed Aug 12, 2015
1 parent 6f902d4 commit 3ac1b9c085169ae77770609415609bdbc27d0e84
@@ -1,8 +1,8 @@
/*
* grunt-html-smoosher
* https://github.com/motherjones/grunt-html-smoosher
* grunt-assets-inline
* https://github.com/sparanoid/assets-inline
*
* Copyright (c) 2013 Ben Breedlove
* Copyright (c) 2015 Tunghsiao Liu
* Licensed under the MIT license.
*/
@@ -29,7 +29,7 @@ module.exports = function(grunt) {
},
// Configuration to be run (and then tested).
smoosher: {
inline: {
default_options: {
files: {
'tmp/default_options': 'test/fixtures/index.html',
@@ -54,7 +54,7 @@ module.exports = function(grunt) {
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'smoosher', 'nodeunit']);
grunt.registerTask('test', ['clean', 'inline', 'nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
File renamed without changes.
@@ -1,32 +1,33 @@
# grunt-html-smoosher
[![Build Status](https://api.travis-ci.org/sparanoid/grunt-html-smoosher.svg?branch=master)](https://travis-ci.org/sparanoid/grunt-html-smoosher)
# grunt-assets-inline
[![Build Status](https://api.travis-ci.org/sparanoid/grunt-assets-inline.svg?branch=master)](https://travis-ci.org/sparanoid/grunt-assets-inline)
> A grunt task which takes a html file, finds all the css and js links, and outputs a version with all the css and js written inline for ease of pasting into a cms
> A grunt task which takes a html file, finds all the css, js links and images, and outputs a version with all the css, js and images (Base64) written inline.
## Getting Started
This plugin requires Grunt `~0.4.1`
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-html-smoosher --save-dev
npm install grunt-assets-inline --save-dev
```
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks('grunt-html-smoosher');
grunt.loadNpmTasks('grunt-assets-inline');
```
## The "smoosher" task
## The "inline" task
### Overview
In your project's Gruntfile, add a section named `smoosher` to the data object passed into `grunt.initConfig()`.
In your project's Gruntfile, add a section named `inline` to the data object passed into `grunt.initConfig()`.
```js
grunt.initConfig({
smoosher: {
inline: {
options: {
jsTags: { // optional
start: '<script type="text/javascript">', // default: <script>
@@ -53,7 +54,7 @@ Minify scripts with UglifyJS.
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
minify: true
@@ -74,7 +75,7 @@ When you have absolute paths for your external assets, it helps to add the local
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
jsDir: "../",
@@ -107,7 +108,7 @@ If you want to smoosh `img` sources to Base64 in HTML, you can set `inlineImg` t
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineImg: true
@@ -128,7 +129,7 @@ If you want to smoosh SVGs in `img` tags in HTML, you can set `inlineSvg` to tru
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineSvg: true
@@ -149,7 +150,7 @@ Defaults to `false`.
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineSvg: true,
@@ -177,7 +178,7 @@ This option only searchs for URLs begin with `../`.
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
assetsUrlPrefix: '<%= config.base %>/assets/'
@@ -196,7 +197,7 @@ Defaults to `""`.
```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
includeTag: "?assets-inline"
@@ -1,26 +1,24 @@
{
"name": "grunt-html-smoosher",
"description": "A grunt task which takes a html file, finds all the css and js links, and outputs a version with all the css and js written inline for ease of pasting into a cms",
"name": "grunt-assets-inline",
"description": "A grunt task which takes a html file, finds all the css, js links and images, and outputs a version with all the css, js and images (Base64) written inline.",
"version": "0.1.6",
"homepage": "https://github.com/motherjones/grunt-html-smoosher",
"homepage": "https://github.com/sparanoid/grunt-assets-inline",
"author": {
"name": "Ben Breedlove",
"email": "benbreedlove@gmail.com",
"url": "https://github.com/benbreedlove"
"name": "Tunghsiao Liu",
"email": "t@sparanoid.com"
},
"contributors": [{
"name": "Ben Breedlove",
"email": "benbreedlove@gmail.com"
}],
"repository": {
"type": "git",
"url": "git://github.com/motherjones/grunt-html-smoosher.git"
"url": "git://github.com/sparanoid/grunt-assets-inline.git"
},
"bugs": {
"url": "https://github.com/motherjones/grunt-html-smoosher/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/motherjones/grunt-html-smoosher/blob/master/LICENSE-MIT"
}
],
"url": "https://github.com/sparanoid/grunt-assets-inline/issues"
},
"license": "MIT",
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
@@ -45,6 +43,9 @@
"gruntplugin",
"embed",
"stylesheet",
"javascript"
"javascript",
"css",
"js",
"svg"
]
}
@@ -1,3 +1,11 @@
/*
* grunt-assets-inline
* https://github.com/sparanoid/assets-inline
*
* Copyright (c) 2015 Tunghsiao Liu
* Licensed under the MIT license.
*/
/*
* grunt-html-smoosher
* https://github.com/motherjones/grunt-html-smoosher
@@ -15,7 +23,7 @@ module.exports = function(grunt) {
var url = require('url');
var uglify = require('uglify-js');
grunt.registerMultiTask('smoosher', 'Turn your distribution into something pastable.', function() {
grunt.registerMultiTask('inline', 'Turn your distribution into something pastable.', function() {
var options = this.options({
jsDir: "",
@@ -22,7 +22,7 @@ var grunt = require('grunt');
test.ifError(value)
*/
exports.html_smoosher = {
exports.assets_inline = {
setUp: function(done) {
// setup here if necessary
done();

0 comments on commit 3ac1b9c

Please sign in to comment.