Last active
September 7, 2015 10:22
-
-
Save tonybolanyo/d6d1906d1c4e2a10d868 to your computer and use it in GitHub Desktop.
Esqueleto proyecto grunt para plantillas HTML5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Plantilla HTML5", | |
"author": "Tony G. Bolaño", | |
"date": "septiembre 2015", | |
"description": "Plantilla HTML5 con referencia a jQuery, html5shiv, Respond.js, ie10-viewport-bug-workaround" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
clean: { | |
dist: [ | |
'public' | |
] | |
}, | |
sass: { | |
dist: { | |
options: { | |
style: 'compressed' | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'src/styles', | |
src: ['*.scss'], | |
dest: 'public/css', | |
ext: '.css' | |
}] | |
}, | |
dev: { | |
options: { | |
style: 'expanded' | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'src/styles', | |
src: ['*.scss'], | |
dest: 'public/css', | |
ext: '.css' | |
}] | |
} | |
}, | |
uglify: { | |
dist: { | |
options: { | |
compress: { | |
drop_console: true | |
} | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'src/js', | |
src: '**/*.js', | |
dest: 'dest/js' | |
}] | |
}, | |
dev: { | |
options: { | |
beautify: true | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'src/js', | |
src: '**/*.js', | |
dest: 'dest/js' | |
}] | |
} | |
}, | |
copy: { | |
main: { | |
plugins: { | |
files: [{ | |
expand: true, | |
cwd: 'node_modules/...', | |
src: ['fonts/**/*','images/**/*','javascripts/**/*'], | |
dest: 'public/plugins/', | |
}] | |
}, | |
images: { | |
files: [{ | |
expand: true, | |
cwd: 'src/images', | |
src: '**/*', | |
dest: 'public/img' | |
}] | |
} | |
} | |
}, | |
bake: { | |
main: { | |
options: { | |
content: 'def-vars.json' | |
}, | |
files: { | |
'public/index.html': 'src/html/index.html' | |
} | |
} | |
}, | |
watch: { | |
configFiles: { | |
files: [ 'gruntfile.js' ], | |
options: { | |
reload: true | |
} | |
}, | |
html: { | |
files: ['src/html/**/*.html'], | |
tasks: ['bake'] | |
}, | |
scripts: { | |
files: ['src/js/**/*.js'], | |
tasks: ['uglify:dev'] | |
}, | |
styles: { | |
files: ['src/styles/**/*.scss'], | |
tasks: ['sass:dev'] | |
}, | |
images: { | |
files: ['src/images/**/*'], | |
tasks: ['copy:images'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-imagemin'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-bake'); | |
grunt.registerTask('build-dev', ['clean','copy','sass:dev','uglify:dev','bake']); | |
grunt.registerTask('build-dist', ['clean','copy','sass:dist','uglify:dist','bake']); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Estas tres etiquetas *DEBEN* ir las primeras en la cabecera; | |
cualquier otra etiqueta debe aparecer *DETRÁS* de estas tres --> | |
<meta name="description" content="{{description}}"> | |
<meta name="author" content="{{author}}"> | |
<link rel="icon" href="favicon.ico"> | |
<title></title> | |
</head> | |
<body> | |
<header> | |
<h1>{{title}}</h1> | |
</header> | |
<article> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
Vestibulum elementum interdum magna, sed commodo risus dapibus | |
non. Quisque posuere dictum elit ac malesuada. Morbi mauris | |
massa, venenatis sit amet nisi sed, bibendum interdum arcu. | |
In hac habitasse platea dictumst. Curabitur orci neque, | |
pellentesque nec venenatis eu, vehicula venenatis metus. Nama | |
nisl rutrum, pharetra magna quis, accumsan justo. Quisque | |
commodo sollicitudin mauris in pharetra. Nunc scelerisque | |
est eu quam rutrum faucibus. Cras rhoncus quis metus ut | |
pharetra.</p> | |
<p>Maecenas ullamcorper dapibus velit. Mauris dignissim at | |
tortor id tincidunt. Praesent venenatis nunc eu pharetra | |
iaculis. Pellentesque pharetra leo sed venenatis tincidunt. | |
Cras vitae pulvinar massa, sit amet sollicitudin massa. Duis | |
nec semper metus. Quisque volutpat nisi id metus ullamcorper | |
varius nec eu ipsum. Ut posuere leo nec nisl luctus, vitae | |
tincidunt erat tincidunt. Nam non accumsan ligula.</p> | |
</article> | |
<footer> | |
<p>© {{author}}, {{date}}.</p> | |
</footer> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<!-- HTML5 shim and Respond.js para que IE8 sopoerte elementos de HTML5 y media queries --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |
<![endif]--> | |
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |
<script src="https://maxcdn.bootstrapcdn.com/js/ie10-viewport-bug-workaround.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "inssapp-plantilla", | |
"version": "1.0.0", | |
"description": "Diseño de la plantilla para la web de acceso desde el INSS", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Tony G. Bolaño", | |
"license": "ISC", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-bake": "^0.3.14", | |
"grunt-contrib-clean": "^0.6.0", | |
"grunt-contrib-copy": "^0.8.1", | |
"grunt-contrib-imagemin": "^0.9.4", | |
"grunt-contrib-sass": "^0.9.2", | |
"grunt-contrib-uglify": "^0.9.2", | |
"grunt-contrib-watch": "^0.6.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment