diff options
| -rw-r--r-- | index.js | 5 | ||||
| -rw-r--r-- | lib/awmail/index.js | 6 | ||||
| -rw-r--r-- | templates/photo.liquid | 15 |
3 files changed, 23 insertions, 3 deletions
@@ -10,6 +10,10 @@ var viewConfig = { ] } +var photoConfig = { + template: 'photo', +} + var app = okcms.createApp({ project: 'Hansel and Gretel', @@ -59,6 +63,7 @@ var app = okcms.createApp({ '/timeline': viewConfig, '/timeline/:id': viewConfig, '/page/:id': viewConfig, + '/photo/:id': photoConfig, }, services: { diff --git a/lib/awmail/index.js b/lib/awmail/index.js index 5ef6840..159960e 100644 --- a/lib/awmail/index.js +++ b/lib/awmail/index.js @@ -58,9 +58,11 @@ function AWMail (options) { }) }).then(function(url){ console.log("parse templates") - console.log(url) + // https://marsupial.s3.amazonaws.com/armory/mail/260b1e90-380e-11e7-b0c0-190f661d482a.jpg + var hash = url.replace('https://marsupial.s3.amazonaws.com/armory/mail/','').replace('.jpg','') var templateData = { email: email, + hash: hash, } return parseTemplates(templateData) }).then(function(mailData){ @@ -120,8 +122,6 @@ function AWMail (options) { function uploadImage (data){ return Q.Promise(function(resolve, reject, notify) { - console.log(data.file) - upload.put({ file: data.file, preserveFilename: false, diff --git a/templates/photo.liquid b/templates/photo.liquid new file mode 100644 index 0000000..de229fa --- /dev/null +++ b/templates/photo.liquid @@ -0,0 +1,15 @@ +<!doctype html> +<html> +<head> +<title>Hansel and Gretel - Armory on Park</title> +</head> +<body> + +</body> +<script> +var hash = document.location.pathname.replace('/photo/','').replace(/\/.*/,'') +var img = new Image +img.src = 'https://marsupial.s3.amazonaws.com/armory/mail/' + hash + '.jpg' +document.body.appendChild(img) +</script> +</html> |
