Skip to content

Commit 290555e

Browse files
committed
chore(git): add current files
1 parent 19d0902 commit 290555e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+47383
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
node_modules
3+
.sass-cache
4+
.secret
5+
preview/css
6+
src/css/*.css
7+
*.css.map
8+
*.code-workspace
9+
secrets.json
10+
dist/*
11+
!dist/.gitkeep

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/erbium

Gruntfile.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = function(grunt) {
2+
3+
require('load-grunt-config')(grunt, {
4+
5+
// Pass data to tasks
6+
data: {
7+
8+
// Re-usable filesystem path variables
9+
paths: {
10+
src: 'src',
11+
src_img: 'src/img',
12+
dist: 'dist',
13+
dist_img: 'dist/img',
14+
preview: 'preview'
15+
},
16+
17+
// secrets.json is ignored in git because it contains sensitive data
18+
// See the README for configuration settings
19+
secrets: grunt.file.readJSON('secrets.json')
20+
21+
}
22+
});
23+
};

dist/.gitkeep

Whitespace-only changes.

grunt/aliases.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Where we tell Grunt what to do when we type "grunt" into the terminal
2+
# $ grunt
3+
default:
4+
- 'clean'
5+
- 'sass:dist'
6+
- 'assemble'
7+
- 'juice'
8+
- 'imagemin'
9+
- 'replace:src_images'
10+
11+
# Use grunt send if you want to actually send the email to your inbox
12+
# $ grunt send --template=transaction.html
13+
send:
14+
- 'mailgun'
15+
16+
# Upload images to your CDN on Rackspace Cloud Files
17+
# $ grunt rsupload
18+
rsupload:
19+
- 'default'
20+
- 'cloudfiles'
21+
- 'cdn:cloudfiles'
22+
23+
# Upload image files to Amazon S3
24+
# $ grunt s3upload
25+
s3upload:
26+
- 'default'
27+
- 'aws_s3:prod'
28+
- 'cdn:aws_s3'
29+
30+
# Launch the express server and start watching
31+
# $ grunt serve
32+
serve:
33+
- 'default'
34+
- 'sass:preview'
35+
- 'autoprefixer:preview'
36+
- 'express'
37+
- 'open'
38+
- 'watch'

grunt/assemble.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Assembles your email content with HTML layout
2+
module.exports = {
3+
options: {
4+
layoutdir: '<%= paths.src %>/layouts',
5+
partials: ['<%= paths.src %>/partials/**/*.hbs'],
6+
helpers: ['<%= paths.src %>/helpers/**/*.js'],
7+
data: ['<%= paths.src %>/data/*.{json,yml}'],
8+
flatten: true
9+
},
10+
pages: {
11+
src: ['<%= paths.src %>/emails/*.hbs'],
12+
dest: '<%= paths.dist %>/'
13+
}
14+
};

grunt/autoprefixer.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Browser-based preview task
2+
module.exports = {
3+
preview: {
4+
options: {
5+
browsers: ['last 6 versions', 'ie 9']
6+
},
7+
src: 'preview/css/preview.css'
8+
}
9+
}

grunt/aws_s3.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Use Amazon S3 for images
2+
// grunt s3upload
3+
module.exports = {
4+
options: {
5+
accessKeyId: '<%= secrets.s3.key %>', // See README for secrets.json
6+
secretAccessKey: '<%= secrets.s3.secret %>', // See README for secrets.json
7+
region: '<%= secrets.s3.region %>', // Enter region or leave blank for US Standard region
8+
uploadConcurrency: 5, // 5 simultaneous uploads
9+
downloadConcurrency: 5 // 5 simultaneous downloads
10+
},
11+
12+
prod: {
13+
options: {
14+
bucket: '<%= secrets.s3.bucketname %>', // Define your S3 bucket name in secrets.json
15+
differential: true, // Only uploads the files that have changed
16+
params: {
17+
CacheControl: '2000'
18+
}
19+
},
20+
files: [
21+
{expand: true, cwd: '<%= paths.dist_img %>', src: ['**'], dest: '<%= secrets.s3.bucketdir %>/<%= paths.dist_img %>'}
22+
]
23+
}
24+
};

grunt/cdn.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// CDN will replace local paths with your CDN path
2+
module.exports = {
3+
cloudfiles: {
4+
options: {
5+
cdn: '<%= secrets.cloudfiles.uri %>', // See README for secrets.json or replace this with your cdn uri
6+
flatten: true,
7+
supportedTypes: 'html'
8+
},
9+
cwd: './<%= paths.dist %>',
10+
dest: './<%= paths.dist %>',
11+
src: ['*.html']
12+
},
13+
14+
aws_s3: {
15+
options: {
16+
cdn: '<%= secrets.s3.bucketuri %>/<%= secrets.s3.bucketname %>/<%= secrets.s3.bucketdir %>', // See README for secrets.json or replace this with your Amazon S3 bucket uri
17+
flatten: true,
18+
supportedTypes: 'html'
19+
},
20+
cwd: './<%= paths.dist %>',
21+
dest: './<%= paths.dist %>',
22+
src: ['*.html']
23+
}
24+
};

grunt/clean.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Clean your /dist folder
2+
module.exports = {
3+
clean: ['!<%= paths.dist %>/.gitkeep', '<%= paths.dist %>/**/*']
4+
};

grunt/cloudfiles.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Use Rackspace Cloud Files if you're using images in your email
2+
// grunt cdnify
3+
module.exports = {
4+
prod: {
5+
'user': '<%= secrets.cloudfiles.user %>', // See README for secrets.json or replace this with your user
6+
'key': '<%= secrets.cloudfiles.key %>', // See README for secrets.json or replace this with your own key
7+
'region': '<%= secrets.cloudfiles.region %>', // See README for secrets.json or replace this with your region
8+
'upload': [{
9+
'container': '<%= secrets.cloudfiles.container %>', // See README for secrets.json or replace this with your container name
10+
'src': '<%= paths.dist_img %>/*',
11+
'dest': '/',
12+
'stripcomponents': 0
13+
}]
14+
}
15+
};

grunt/express.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Browser-based preview task
2+
module.exports = {
3+
server: {
4+
options: {
5+
port: 4000,
6+
hostname: '127.0.0.1',
7+
bases: ['<%= paths.dist %>', '<%= paths.preview %>', '<%= paths.src %>'],
8+
server: './server.js',
9+
livereload: true
10+
}
11+
}
12+
}

grunt/imagemin.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Compress images
2+
module.exports = {
3+
dynamic: {
4+
options: {
5+
optimizationLevel: 3,
6+
svgoPlugins: [{ removeViewBox: false }]
7+
},
8+
9+
files: [{
10+
expand: true,
11+
cwd: '<%= paths.src_img %>',
12+
src: ['**/*.{png,jpg,gif}'],
13+
dest: '<%= paths.dist_img %>'
14+
}]
15+
}
16+
};

grunt/juice.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Inlines your CSS
2+
module.exports = {
3+
your_target: {
4+
options: {
5+
preserveMediaQueries: true,
6+
applyAttributesTableElements: true,
7+
applyWidthAttributes: true,
8+
preserveImportant: true,
9+
preserveFontFaces: true,
10+
webResources: {
11+
images: false
12+
}
13+
},
14+
files: [{
15+
expand: true,
16+
src: ['<%= paths.dist %>/*.html'],
17+
dest: ''
18+
}]
19+
}
20+
};

grunt/litmus.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Send your email template to Litmus for testing
2+
// grunt litmus --template=transaction.html
3+
module.exports = function(grunt) {
4+
return {
5+
test: {
6+
src: ['<%= paths.dist %>/'+grunt.option('template')],
7+
options: {
8+
username: '<%= secrets.litmus.username %>', // See README for secrets.json or replace this with your username
9+
password: '<%= secrets.litmus.password %>', // See README for secrets.json or replace this with your password
10+
url: 'https://<%= secrets.litmus.company %>.litmus.com', // See README for secrets.json or replace this with your company url
11+
clients: ['android4', 'aolonline', 'androidgmailapp', 'aolonline', 'ffaolonline',
12+
'chromeaolonline', 'appmail6', 'iphone6', 'ipadmini', 'ipad', 'chromegmailnew',
13+
'iphone6plus', 'notes85', 'ol2002', 'ol2003', 'ol2007', 'ol2010', 'ol2011',
14+
'ol2013', 'outlookcom', 'chromeoutlookcom', 'chromeyahoo', 'windowsphone8'] // https://#{company}.litmus.com/emails/clients.xml
15+
}
16+
}
17+
}
18+
};

grunt/mailgun.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Use Mailgun option if you want to email the design to your inbox or to something like Litmus
2+
module.exports = function(grunt) {
3+
return {
4+
mailer: {
5+
options: {
6+
key: '<%= secrets.mailgun.api_key %>', // See README for secrets.json or replace this with your own key
7+
domain: '<%= secrets.mailgun.domain %>', // See README for secrets.json or replace this with your own email domain
8+
sender: '<%= secrets.mailgun.sender %>', // See README for secrets.json or replace this with your preferred sender
9+
recipient: '<%= secrets.mailgun.recipient %>', // See README for secrets.json or replace this with your preferred recipient
10+
subject: 'This is a test email'
11+
},
12+
src: ['<%= paths.dist %>/'+grunt.option('template')]
13+
}
14+
}
15+
};

grunt/open.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Browser-based preview task
2+
module.exports = {
3+
preview: {
4+
path: 'http://localhost:4000'
5+
}
6+
}

grunt/replace.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Replace compiled template images sources from ../src/html to ../dist/html
2+
module.exports = {
3+
src_images: {
4+
options: {
5+
usePrefix: false,
6+
patterns: [
7+
{
8+
match: /(<img[^>]+[\"'])(\.\.\/src\/img\/)/gi, // Matches <img * src="../src/img or <img * src='../src/img'
9+
replacement: '$1../<%= paths.dist_img %>/'
10+
},
11+
{
12+
match: /(url\(*[^)])(\.\.\/src\/img\/)/gi, // Matches url('../src/img') or url(../src/img) and even url("../src/img")
13+
replacement: '$1../<%= paths.dist_img %>/'
14+
}
15+
]
16+
},
17+
18+
files: [{
19+
expand: true,
20+
flatten: true,
21+
src: ['<%= paths.dist %>/*.html'],
22+
dest: '<%= paths.dist %>'
23+
}]
24+
}
25+
};

grunt/sass.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Takes your SCSS files and compiles them to CSS
2+
const sass = require('node-sass');
3+
4+
module.exports = {
5+
dist: {
6+
options: {
7+
style: 'expanded',
8+
implementation: sass
9+
},
10+
files: [
11+
{
12+
expand: true,
13+
flatten: true, // do not create subfolders
14+
cwd: '<%= paths.src %>/css/scss/',
15+
src: ['*/**/*.scss', '!*/**/_*.scss'],
16+
dest: '<%= paths.src %>/css/',
17+
ext: '.css',
18+
}
19+
]
20+
},
21+
22+
// This task compiles Sass for the browser-baed preview UI.
23+
// You should not need to edit it.
24+
preview: {
25+
options: {
26+
style: 'compressed',
27+
implementation: sass
28+
},
29+
files: {
30+
'<%= paths.preview %>/css/preview.css': '<%= paths.preview %>/scss/preview.scss'
31+
}
32+
}
33+
};

grunt/watch.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Watches for changes to CSS or email templates then runs grunt tasks
2+
module.exports = {
3+
emails: {
4+
files: ['<%= paths.src %>/css/scss/*/**','<%= paths.src %>/emails/*','<%= paths.src %>/layouts/*','<%= paths.src %>/partials/**/*','<%= paths.src %>/data/*'],
5+
tasks: ['default']
6+
},
7+
preview_dist: {
8+
files: ['./dist/*'],
9+
tasks: [],
10+
options: {
11+
livereload: true
12+
}
13+
},
14+
preview: {
15+
files: ['<%= paths.preview %>/scss/*'],
16+
tasks: ['sass:preview','autoprefixer:preview'],
17+
options: {
18+
livereload: true
19+
}
20+
}
21+
};

license.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) [2014] [Lee Munroe]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)