From: Geoff Kimball Date: Tue, 12 Jan 2016 22:03:00 +0000 (-0800) Subject: Re-add testing folder, not as a submodule X-Git-Tag: v2.0.0-rc.1~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1c6bb1fa2b22f20a86641659587115e134e92e0;p=thirdparty%2Ffoundation%2Ffoundation-emails.git Re-add testing folder, not as a submodule --- diff --git a/testing/.babelrc b/testing/.babelrc new file mode 100644 index 00000000..c13c5f62 --- /dev/null +++ b/testing/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 00000000..242dc11b --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +node_modules +npm-debug.log +bower_components +dist +.sass-cache diff --git a/testing/LICENSE b/testing/LICENSE new file mode 100644 index 00000000..73d6b962 --- /dev/null +++ b/testing/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2013-2015 ZURB, inc. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/testing/README.md b/testing/README.md new file mode 100644 index 00000000..4b083530 --- /dev/null +++ b/testing/README.md @@ -0,0 +1,3 @@ +# Foundation for Emails Template + +This is a starter template for a project created with Foundation for Emails, a responsive email framework from ZURB. diff --git a/testing/bower.json b/testing/bower.json new file mode 100644 index 00000000..4af54f8a --- /dev/null +++ b/testing/bower.json @@ -0,0 +1,18 @@ +{ + "name": "foundation-emails-template", + "version": "0.0.1", + "authors": [ + "ZURB " + ], + "description": "Basic template for a Foundation for Emails project.", + "main": "gulpfile.js", + "license": "MIT", + "homepage": "http://foundation.zurb.com/emails", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/testing/gulpfile.babel.js b/testing/gulpfile.babel.js new file mode 100644 index 00000000..2179f2cd --- /dev/null +++ b/testing/gulpfile.babel.js @@ -0,0 +1,113 @@ +import gulp from 'gulp'; +import plugins from 'gulp-load-plugins'; +import browser from 'browser-sync'; +import mq from 'media-query-extractor'; +import rimraf from 'rimraf'; +import panini from 'panini'; +import yargs from 'yargs'; +import lazypipe from 'lazypipe'; +import inky from 'inky'; + +const $ = plugins(); + +// Look for the --production flag +const isProduction = !!(yargs.argv.production); + +// Only inline if the --production flag is enabled +var buildTasks = [clean, copy, pages, sass]; +if (isProduction) buildTasks.push(inline); + +// Delete the "dist" folder +// This happens every time a build starts +function clean(done) { + rimraf('dist', done); +} + +// Compile layouts, pages, and partials into flat HTML files +// Then parse using Inky templates +function pages() { + return gulp.src('src/pages/**/*.html') + .pipe(panini({ + root: 'src/pages', + layouts: 'src/layouts', + partials: 'src/partials' + })) + .pipe(inky()) + .pipe(gulp.dest('dist')); +} + +function resetPages(done) { + panini.refresh(); + done(); +} + +// Compile Sass into CSS +function sass() { + return gulp.src('src/assets/scss/app.scss') + .pipe($.if(!isProduction, $.sourcemaps.init())) + .pipe($.sass().on('error', $.sass.logError)) + .pipe($.if(!isProduction, $.sourcemaps.write())) + .pipe(gulp.dest('dist/css')); +} + +// Inline CSS and minify HTML +function inline() { + return gulp.src('dist/**/*.html') + .pipe(inliner({ + css: 'dist/css/app.css' + })) + .pipe(gulp.dest('dist')); +} + +// Copy static assets +function copy() { + return gulp.src('src/assets/img/*') + .pipe(gulp.dest('./dist/assets/img')); +} + +// Build the "dist" folder by running all of the above tasks +gulp.task('build', + gulp.series.apply(gulp, buildTasks)); + +// Build emails, run the server, and watch for file changes +gulp.task('default', + gulp.series('build', server, watch)); + +// Start a server with LiveReload to preview the site in +function server(done) { + browser.init({ + server: 'dist' + }); + done(); +} + +// Watch for file changes +function watch() { + gulp.watch('src/pages/**/*.html', gulp.series(pages, browser.reload)); + gulp.watch(['src/layouts/**/*', 'src/partials/**/*'], gulp.series(resetPages, pages, browser.reload)); + gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss'], gulp.series(sass, browser.reload)); +} + +function inliner(options) { + var cssPath = options.css; + var cssMqPath = cssPath.replace(/\.css$/, '-mq.css'); + + // Extracts media query-specific CSS into a separate file + mq(cssPath, cssMqPath, [ + 'only screen and (max-width: 580px)|' + cssMqPath + ]); + + var pipe = lazypipe() + .pipe($.inlineCss) + .pipe($.inject, gulp.src(cssMqPath), { + transform: function(path, file) { + return ''; + } + }) + .pipe($.htmlmin, { + collapseWhitespace: false, + minifyCSS: true + }); + + return pipe(); +} diff --git a/testing/package.json b/testing/package.json new file mode 100644 index 00000000..e5ce7efa --- /dev/null +++ b/testing/package.json @@ -0,0 +1,33 @@ +{ + "name": "foundation-emails-template", + "version": "0.0.1", + "description": "Basic template for a Foundation for Emails project.", + "main": "gulpfile.js", + "scripts": { + "start": "gulp", + "build": "gulp --production" + }, + "author": "ZURB ", + "license": "MIT", + "devDependencies": { + "babel-core": "^6.3.26", + "babel-preset-es2015": "^6.3.13", + "browser-sync": "^2.11.0", + "gulp": "git://github.com/gulpjs/gulp.git#4.0", + "gulp-cli": "^1.1.0", + "gulp-htmlmin": "^1.1.1", + "gulp-if": "^2.0.0", + "gulp-inject": "^3.0.0", + "gulp-inline-css": "^3.0.0", + "gulp-load-plugins": "^1.1.0", + "gulp-sass": "^2.1.0", + "gulp-sourcemaps": "^1.6.0", + "gulp-webserver": "^0.9.1", + "inky": "^0.1.0", + "lazypipe": "^1.0.1", + "media-query-extractor": "^0.1.1", + "panini": "^1.1.1", + "rimraf": "^2.3.3", + "yargs": "^3.9.0" + } +} diff --git a/testing/src/assets/scss/_settings.scss b/testing/src/assets/scss/_settings.scss new file mode 100644 index 00000000..bfd0a1f5 --- /dev/null +++ b/testing/src/assets/scss/_settings.scss @@ -0,0 +1,125 @@ +// Foundation for Emails Settings +// ------------------------------ +// +// Table of Contents: +// +// 1. Global +// 2. Grid +// 3. Block Grid +// 4. Button +// 5. Callout +// 6. Media Query +// 7. Normalize +// 8. Thumbnail +// 9. Typography + + +// 1. Global +// --------- + +$primary-color: #2199e8; +$secondary-color: #777; +$success-color: #3adb76; +$warning-color: #ffae00; +$alert-color: #ec5840; +$light-gray: #f3f3f3; +$medium-gray: #cacaca; +$dark-gray: #8a8a8a; +$black: #0a0a0a; +$white: #fefefe; +$pre-color: #ff6908; +$column-gutter: 20px; +$container-width: 580px; +$global-radius: 3px; +$global-rounded: 500px; + +// 2. Grid +// ------- + +$grid-column-count: 12; +$wrapper-padding-top: 10px; +$column-padding-bottom: 10px; +$sub-column-padding-right: $column-gutter / 2; + +// 3. Block Grid +// ------------- + +$block-grid-elements: 8; +$block-grid-spacing: $column-gutter; + +// 4. Button +// --------- + +$button-padding: 12px 0 12px 0; +$button-padding-tiny: 5px 0 4px 0; +$button-padding-small: 8px 0 7px; +$button-padding-large: 21px 0 18px; +$button-font-color: $white; +$button-font-color-alt: $medium-gray; +$button-font-weight: bold; +$button-font-size: 20px; +$button-font-size-tiny: 12px; +$button-font-size-small: 16px; +$button-font-size-large: 24px; +$button-background-color: $primary-color; +$button-border: 1px solid darken($button-background-color, 10%); + +// 5. Callout +// ---------- + +$callout-background-color: $light-gray; +$callout-padding: 10px; +$callout-border: 1px solid darken($callout-background-color, 20%); +$callout-border-success: 1px solid darken($success-color, 20%); +$callout-border-warning: 1px solid darken($warning-color, 20%); +$callout-border-alert: 1px solid darken darken($alert-color, 20%); + +// 6. Media Query +// -------------- + +$small-container-width: 95%; +$small-range: $container-width; + +// 7. Normalize +// ------------ + +$hr-color: $medium-gray; +$hr-height: 1px; + +// 8. Thumbnail +// ------------ + +$thumbnail-shadow-h: 0; +$thumbnail-shadow-v: 0; +$thumbnail-shadow-blur: 6px; +$thumbnail-shadow-spread: 1px; +$thumbnail-shadow-color: $primary-color; +$thumbnail-shadow-opacity: 0.5; + +// 9. Typography +// ------------- + +$global-font-color: $black; +$global-font-family: Helvetica, Arial, sans-serif; +$global-font-weight: normal; +$global-line-height: 1.3; +$body-font-size: 14px; +$body-line-height: 19px; +$header-font-family: Georgia, Times, serif; +$h1-font-size: 40px; +$h2-font-size: 36px; +$h3-font-size: 32px; +$h4-font-size: 28px; +$h5-font-size: 24px; +$h6-font-size: 20px; +$small-font-size: 10px; +$paragraph-lead-font-size: 18px; +$paragraph-lead-line-height: 21px; +$paragraph-margin-bottom: 10px; +$text-padding: 10px; +$anchor-text-decoration: none; +$anchor-font-color: $primary-color; +$anchor-font-color-visited: $anchor-font-color; +$anchor-font-color-hover: darken($primary-color, 10%); +$anchor-font-color-active: $anchor-font-color-hover; + diff --git a/testing/src/assets/scss/app.scss b/testing/src/assets/scss/app.scss new file mode 100644 index 00000000..e3b95f67 --- /dev/null +++ b/testing/src/assets/scss/app.scss @@ -0,0 +1,2 @@ +@import 'settings'; +@import '../../../../scss/ink'; diff --git a/testing/src/layouts/default.html b/testing/src/layouts/default.html new file mode 100644 index 00000000..cb4ef709 --- /dev/null +++ b/testing/src/layouts/default.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + +
+
+ {{> body}} +
+
+ + diff --git a/testing/src/pages/basic.html b/testing/src/pages/basic.html new file mode 100644 index 00000000..14dfcc19 --- /dev/null +++ b/testing/src/pages/basic.html @@ -0,0 +1,76 @@ + + +
+ + + + + + + Basic + + + +
+ +
+ + + +

Hi, Susan Calvin

+

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae.

+

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. consequat vel lacus. Sed iaculis pulvinar ligula, ornare fringilla ante viverra et. In hac habitasse platea dictumst. Donec vel orci mi, eu congue justo. Integer eget odio est, eget malesuada lorem. Aenean sed tellus dui, vitae viverra risus. Nullam massa sapien, pulvinar eleifend fringilla id, convallis eget nisi. Mauris a sagittis dui. Pellentesque non lacinia mi. Fusce sit amet libero sit amet erat venenatis sollicitudin vitae vel eros. Cras nunc sapien, interdum sit amet porttitor ut, congue quis urna.

+
+
+ + + +

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »

+ +
+
+ + + +
Connect With Us:
+ + + + + +
+ + + + + +
+ + + + +
+ Google + +
+ +
+ + +
Contact Info:
+

Phone: 408.341.0600

+

Email: hseldon@trantor.com

+ +
+
+ + +
+

Terms | Privacy | Unsubscribe

+
+
+
+
diff --git a/testing/src/pages/index.html b/testing/src/pages/index.html new file mode 100644 index 00000000..14dfcc19 --- /dev/null +++ b/testing/src/pages/index.html @@ -0,0 +1,76 @@ + + +
+ + + + + + + Basic + + + +
+ +
+ + + +

Hi, Susan Calvin

+

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae.

+

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. consequat vel lacus. Sed iaculis pulvinar ligula, ornare fringilla ante viverra et. In hac habitasse platea dictumst. Donec vel orci mi, eu congue justo. Integer eget odio est, eget malesuada lorem. Aenean sed tellus dui, vitae viverra risus. Nullam massa sapien, pulvinar eleifend fringilla id, convallis eget nisi. Mauris a sagittis dui. Pellentesque non lacinia mi. Fusce sit amet libero sit amet erat venenatis sollicitudin vitae vel eros. Cras nunc sapien, interdum sit amet porttitor ut, congue quis urna.

+
+
+ + + +

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »

+ +
+
+ + + +
Connect With Us:
+ + + + + +
+ + + + + +
+ + + + +
+ Google + +
+ +
+ + +
Contact Info:
+

Phone: 408.341.0600

+

Email: hseldon@trantor.com

+ +
+
+ + +
+

Terms | Privacy | Unsubscribe

+
+
+
+
diff --git a/testing/src/pages/side-bar.html b/testing/src/pages/side-bar.html new file mode 100644 index 00000000..2bf6423c --- /dev/null +++ b/testing/src/pages/side-bar.html @@ -0,0 +1,45 @@ + + + +
+ +
+
+
+
+ + + +

Hello,
Han Fastolfe

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.

+
+ +

Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »

+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.

+ +
+ + +
Header Thing
+

Sub-head or something

+ + Just a Plain Link » + Just a Plain Link » + Just a Plain Link » + Just a Plain Link » + Just a Plain Link » + Just a Plain Link » + Just a Plain Link » +
+
+ + +
+

Terms | Privacy | Unsubscribe

+
+
+
+
diff --git a/testing/src/partials/footer.html b/testing/src/partials/footer.html new file mode 100644 index 00000000..985208da --- /dev/null +++ b/testing/src/partials/footer.html @@ -0,0 +1,7 @@ + + +
+

Terms | Privacy | Unsubscribe

+
+
+
\ No newline at end of file diff --git a/testing/src/partials/header.html b/testing/src/partials/header.html new file mode 100644 index 00000000..e69de29b