diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-04-05 17:57:05 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-04-05 17:58:21 -0400 |
| commit | c88541abc8a4ec6558a7de7d8c33babe732564d6 (patch) | |
| tree | 9c7ddeb9f96d9a7ec0f98d1bcef35fb3407c2b54 | |
| parent | 983d884971880912c015feadfd51c397277d48ad (diff) | |
gruntfile
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Gruntfile.js | 61 | ||||
| -rw-r--r-- | package.json | 9 | ||||
| -rw-r--r-- | templates/index.liquid | 6 |
4 files changed, 74 insertions, 3 deletions
@@ -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 @@ <span>{{ project.year }}</span> <span>{{ project.client }}</span> <span>{% if project.alternateTitle %}{{ project.alternateTitle }}{% else %}{{ project.title }}{% endif %} - <a href="{{project.link}}" class="projectLink">{% if project.linkText %}{{ project.linkText }}{% else %}Launch Site{% endif %}</a> + {% if project.link %}<a href="{{project.link}}" target="_blank" class="projectLink">{% if project.linkText %}{{ project.linkText }}{% else %}Launch Site{% endif %}</a>{% endif %} </span> <span> <ul> @@ -173,11 +173,11 @@ {% if project.press.length %} <span> <ul> - {% for link in project.press %} + {% for link in project.press %}{% if link.uri %} <li> <a href="{{ link.uri }}">{{ link.text }}</a> </li> - {% endfor %} + {% endif %}{% endfor %} </ul> </span> {% endif %} |
