diff options
| -rw-r--r-- | Gruntfile.js | 89 | ||||
| -rw-r--r-- | package.json | 25 |
2 files changed, 114 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..18c6a8b --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,89 @@ +module.exports = function (grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + swig: { + dist: { + init: { + root: "pages/", + allowErrors: false, + autoescape: true + }, + banners: grunt.file.readJSON('pages/banners.json'), + dest: "dist/", + cwd: "pages/", + generateSitemap: false, + generateRobotstxt: false, + src: [ + 'index.swig', + 'faq.swig', + 'tools.swig' + ], + siteUrl: 'http://pomf.se/', + production: false, + } + }, + uglify: { + options: { + banner: '/*! <%= pkg.name %> (<%= pkg.repository.url %>) @ <%= grunt.template.today("yyyy-mm-dd") %> */\n\n' + }, + dist: { + files: { + 'dist/pomf.min.js': [ + 'js/zepto.js', + 'js/cheesesteak.js', + 'js/cabinet.js', + 'js/pomf.js' + ] + } + } + }, + cssmin: { + options: { + banner: '/*! <%= pkg.name %> (<%= pkg.repository.url %>) @ <%= grunt.template.today("yyyy-mm-dd") %> */\n\n' + }, + dist: { + files: { + 'dist/pomf.min.css': [ + 'css/pomf.css' + ] + } + } + }, + mkdir: { + options: { + mode: 0700, + create: ['dist/img'] + } + }, + imagemin: { + dist: { + files: [{ + expand: true, + cwd: 'img/', + src: '**/*.{png,jpg,gif}', + dest: 'dist/img/' + }] + } + }, + copy: { + dist: { + files: [{ + expand: true, + cwd: 'static/', + src: '**', + dest: 'dist/' + }] + } + } + }); + + grunt.loadNpmTasks('grunt-swig'); + grunt.loadNpmTasks('grunt-mkdir'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-htmlmin'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-imagemin'); + grunt.loadNpmTasks('grunt-contrib-copy'); + + grunt.registerTask('default', ['mkdir', 'swig', 'cssmin', 'uglify', 'imagemin', 'copy']); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..cd2cf36 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "pomf", + "version": "1.0.0", + "description": "kawaii file host", + "homepage": "http://pomf.se/", + "repository": { + "type": "git", + "url": "https://github.com/nokonoko/Pomf.git" + }, + "author": "Neku <neku@pomf.se>", + "license": "MIT", + "bugs": { + "url": "https://github.com/nokonoko/Pomf/issues" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-swig": "~0.1.2", + "grunt-mkdir": "~0.1.1", + "grunt-contrib-uglify": "~0.2.5", + "grunt-contrib-htmlmin": "~0.1.3", + "grunt-contrib-imagemin": "~0.3.0", + "grunt-contrib-cssmin": "~0.6.2", + "grunt-contrib-copy": "~0.4.1" + } +} |
