From: RafiBomb Date: Thu, 18 Feb 2016 19:45:15 +0000 (-0800) Subject: adds info banner partial and changes text and link X-Git-Tag: v6.2.0~1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f5e0ead65fdaf6d98300e2fe0b4b6901e22dcb;p=thirdparty%2Ffoundation%2Ffoundation-sites.git adds info banner partial and changes text and link --- diff --git a/docs/assets/img/gulpfile.js b/docs/assets/img/gulpfile.js new file mode 100755 index 000000000..56cffd658 --- /dev/null +++ b/docs/assets/img/gulpfile.js @@ -0,0 +1,167 @@ +var $ = require('gulp-load-plugins')(); +var argv = require('yargs').argv; +var gulp = require('gulp'); +var rimraf = require('rimraf'); +var panini = require('panini'); +var sequence = require('run-sequence'); + +// Check for --production flag +var isProduction = !!(argv.production); + +// File paths to various assets are defined here. +var paths = { + assets: [ + 'src/assets/**/*', + '!src/assets/{!img,js,scss}/**/*' + ], + downloads: [ + 'src/downloads/**/*.*' + ], + sass: [ + 'bower_components/foundation-sites/scss' + ], + javascript: [ + 'node_modules/jquery/dist/jquery.js', + 'bower_components/foundation-sites/dist/foundation.js', + 'bower_components/what-input/what-input.js', + 'src/assets/js/**/*.js', + 'bower_components/lodash/lodash.js', + 'src/assets/js/app.js' + ] +}; + +// Delete the "dist" folder +// This happens every time a build starts +gulp.task('clean', function(done) { + rimraf('./dist', done); +}); + +// Copy files out of the assets folder +// This task skips over the "img", "js", and "scss" folders, which are parsed separately +gulp.task('copy', function(done) { + gulp.src(paths.assets) + .pipe(gulp.dest('./dist/assets')); +}); +gulp.task('downloads', function(done){ + gulp.src('src/downloads/**/*.*') + .pipe(gulp.dest('./dist/downloads')); + done(); +}); + +// Copy page templates into finished HTML files +gulp.task('pages', function() { + gulp.src('./src/pages/**/*.html') + .pipe(panini({ + root: './src/pages/', + layouts: './src/layouts/', + partials: './src/partials/', + data: './src/data/' + })) + .pipe($.cacheBust({ type: 'MD5' })) + .pipe(gulp.dest('./dist')); +}); + +gulp.task('pages:reset', function() { + panini.refresh(); + gulp.run('pages'); +}); + +// Compile Sass into CSS +// In production, the CSS is compressed +gulp.task('sass', function() { + var uncss = $.if(isProduction, $.uncss({ + html: ['src/**/*.html'], + ignore: [ + new RegExp('^meta\..*'), + new RegExp('^\.is-.*') + ] + })); + + return gulp.src('./src/assets/scss/app.scss') + .pipe($.sass({ + includePaths: paths.sass, + outputStyle: isProduction ? 'compressed' : 'nested' + }) + .on('error', $.sass.logError)) + .pipe($.autoprefixer({ + browsers: ['last 2 versions', 'ie >= 9'] + })) + // .pipe(uncss) + .pipe(gulp.dest('./dist/assets/css')); +}); + +// Combine JavaScript into one file +// In production, the file is minified +gulp.task('javascript', function() { + var uglify = $.if(isProduction, $.uglify({ + mangle: false + }) + .on('error', function (e) { + console.log(e); + })); + + return gulp.src(paths.javascript) + .pipe($.concat('app.js')) + .pipe(uglify) + .pipe(gulp.dest('./dist/assets/js')); +}); + +// Compiles HTML templates into JST +gulp.task('jst', function() { + gulp.src('src/templates/*.html') + .pipe($.jstConcat('templates.js', { + renameKeys: ['^.*marketing/(src.*.html)$', '$1'] + })) + .pipe(gulp.dest('dist/assets/js')); +}); + +// Copy images to the "dist" folder +// In production, the images are compressed +gulp.task('images', function() { + var imagemin = $.if(isProduction, $.imagemin({ + progressive: true + })); + + return gulp.src('./src/assets/img/**/*') + // .pipe(imagemin) + .pipe(gulp.dest('./dist/assets/img')); +}); + +// Deploy to the live server +gulp.task('deploy', ['build'], function() { + return gulp.src('./dist/**') + .pipe($.prompt.confirm('Make sure everything looks right before you deploy.')) + .pipe($.rsync({ + root: './dist', + hostname: 'deployer@72.32.134.77', + destination: '/home/deployer/sites/foundation-sites-6-marketing' + })); +}); + +// Build the "dist" folder by running all of the above tasks +gulp.task('build', function(done) { + sequence('clean', ['pages', 'sass', 'javascript', 'images', 'jst', 'downloads'], done); +}); + +// Start a server with LiveReload to preview the site in +gulp.task('server', ['build'], function() { + return gulp.src('./dist') + .pipe($.webserver({ + host: 'localhost', + port: 8000, + livereload: true, + open: true + })); +}); + +// Build the site, run the server, and watch for file changes +gulp.task('default', ['build', 'server'], function() { + gulp.watch(paths.assets, ['copy']); + gulp.watch(['./src/pages/**/*.html'], ['pages']); + gulp.watch(['./src/{layouts,partials}/**/*.html'], ['pages:reset']); + gulp.watch(['./src/assets/scss/**/*.scss'], ['sass']); + gulp.watch(['./src/assets/js/**/*.js'], ['javascript']); + gulp.watch(['bower_components/foundation-sites/dist/foundation.js'], ['javascript']); + gulp.watch(['./src/assets/img/**/*'], ['images']); + gulp.watch(['./src/templates/**/*'], ['jst']); +}); diff --git a/docs/assets/img/inky-banner-bg-boat.svg b/docs/assets/img/inky-banner-bg-boat.svg new file mode 100644 index 000000000..39f453641 --- /dev/null +++ b/docs/assets/img/inky-banner-bg-boat.svg @@ -0,0 +1,563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/assets/img/inky-banner-bg-clear.svg b/docs/assets/img/inky-banner-bg-clear.svg new file mode 100644 index 000000000..d526c7755 --- /dev/null +++ b/docs/assets/img/inky-banner-bg-clear.svg @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/docs/assets/scss/docs.scss b/docs/assets/scss/docs.scss index c76ee3374..7c9da2d2c 100644 --- a/docs/assets/scss/docs.scss +++ b/docs/assets/scss/docs.scss @@ -92,3 +92,40 @@ } } } + + /* Banner for announcements */ +a.notice { + display:block; + overflow: hidden; + position: relative; + padding: 1rem 0; + width:100%; + background: url(../img/inky-banner-bg-boat.svg) no-repeat center center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + + @include breakpoint(medium down) { + background: url(../img/inky-banner-bg-clear.svg) no-repeat center center; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + + } + + .info { + left: 0; + right: 0; + z-index: 20; + margin-left: auto; + margin-right: auto; + + h5 { + color: #ffffff; + text-align: center; + margin-bottom: 0 !important; + } + } +} diff --git a/docs/layout/default.html b/docs/layout/default.html index 513fb996d..05ffab821 100644 --- a/docs/layout/default.html +++ b/docs/layout/default.html @@ -14,6 +14,8 @@ + {{> info-banner}} +
{{> off-canvi}} diff --git a/docs/partials/info-banner.html b/docs/partials/info-banner.html new file mode 100644 index 000000000..f7386c37f --- /dev/null +++ b/docs/partials/info-banner.html @@ -0,0 +1,6 @@ + + +
+
Foundation for Emails 2 Release Candidate is out now!
+
+
\ No newline at end of file