From c88541abc8a4ec6558a7de7d8c33babe732564d6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Apr 2016 17:57:05 -0400 Subject: gruntfile --- .gitignore | 1 + Gruntfile.js | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 ++++++++ templates/index.liquid | 6 ++--- 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 Gruntfile.js diff --git a/.gitignore b/.gitignore index be870a2..7bf8949 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ node_modules restart .env *.sqlite3 +app.concat.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..d6a4504 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,61 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + concat: { + index: { + options: { + separator: "\n;\n" + }, + src: [ + "public/js/vendor/fastclick.js", + "public/js/vendor/flickity.pkfg.js", + "public/js/vendor/iscroll.js", + "public/js/vendor/loader.js", + "public/js/vendor/lodash.min.js", + "public/js/vendor/util.js", + + "public/js/vendor/View.js", + "public/js/vendor/Router.js", + + "public/js/lib/SiteRouter.js", + "public/js/lib/HeaderView.js", + "public/js/lib/NavView.js", + "public/js/lib/ProjectView.js", + "public/js/lib/Scroller.js", + + "public/js/app.js", + ], + dest: 'public/app.concat.js', + }, + }, + + uglify: { + options: { + banner: '/* okfoc.us 2o16 */\n' + }, + index: { + src: 'public/app.concat.js', + dest: 'public/app.min.js' + } + }, + + clean: { + release: [ + "public/app.concat.js", + "tmp/" + ], + } + }); + + // Load tasks that we'll be using + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-dentist'); + + // Default task(s). + grunt.registerTask('default', ['concat', 'uglify', 'clean']); +}; diff --git a/package.json b/package.json index e7d818a..a524921 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,14 @@ "object-assign": "^2.0.0", "okcms": "git+ssh://git@github.com:okfocus/okcms.git#v0.1.26" }, + "devDependencies": { + "grunt": "^0.4.5", + "grunt-cli": "^0.1.13", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-concat": "^0.5.1", + "grunt-dentist": "^0.3.4", + "grunt-contrib-copy": "^0.8.0", + "grunt-contrib-uglify": "^0.9.1" + }, "homepage": "https://github.com/okfocus/portfolio" } diff --git a/templates/index.liquid b/templates/index.liquid index 18bbea3..39142cf 100644 --- a/templates/index.liquid +++ b/templates/index.liquid @@ -149,7 +149,7 @@ {{ project.year }} {{ project.client }} {% if project.alternateTitle %}{{ project.alternateTitle }}{% else %}{{ project.title }}{% endif %} - {% if project.linkText %}{{ project.linkText }}{% else %}Launch Site{% endif %} + {% if project.link %}{% if project.linkText %}{{ project.linkText }}{% else %}Launch Site{% endif %}{% endif %}