summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Gruntfile.js61
-rw-r--r--package.json9
-rw-r--r--templates/index.liquid6
4 files changed, 74 insertions, 3 deletions
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 @@
<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 %}