Skip to content

Commit

Permalink
further fixes, newer gulp version
Browse files Browse the repository at this point in the history
  • Loading branch information
kortenkamp committed Jan 30, 2022
1 parent 5b9d095 commit 263c33f
Show file tree
Hide file tree
Showing 4 changed files with 1,699 additions and 2,570 deletions.
29 changes: 12 additions & 17 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const $ = require("gulp-load-plugins")();
const argv = require("yargs").argv;
const browser = require("browser-sync");
const gulp = require("gulp");
const handlebars = require("handlebars");
const hbs = require("gulp-hbs");
const merge = require("merge-stream");
Expand All @@ -26,6 +25,9 @@ const galleryindex = require("./lib/galleryindex");
const sequence = require('gulp4-run-sequence');
const markdown = require('gulp-markdown');

const gulp = require("gulp");
const sass = require('gulp-sass')(require('sass'));


// Check for --production flag
var isProduction = !!(argv.production);
Expand Down Expand Up @@ -237,22 +239,15 @@ gulp.task('sass', gulp.series([], function() {
new RegExp('^\.is-.*')
]
}));

var minifycss = $.if(isProduction, $.minifyCss());

return pipeline(
gulp.src('src/assets/scss/app.scss'),
$.sourcemaps.init(),
$.sass({
includePaths: PATHS.sass
}).on('error', $.sass.logError),
$.autoprefixer(
// browsers: COMPATIBILITY
),
//.pipe(uncss),
minifycss,
$.if(!isProduction, $.sourcemaps.write()),
gulp.dest('dist/assets/css'));

return gulp.src('src/assets/scss/app.scss')
.pipe($.sourcemaps.init())
.pipe(sass())
.pipe($.autoprefixer())
//.pipe(uncss)
.pipe($.if(isProduction, $.minifyCss()))
.pipe($.sourcemaps.write())
.pipe(gulp.dest('dist/assets/css'))
}));

// Combine JavaScript into one file
Expand Down
4 changes: 2 additions & 2 deletions lib/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ function formatExample(file) {
file.data.title = config['title-en'] || config['title'] || getTitle(widget);

if(path.extname(config.widget) == '.html') widget = formatHTML(widget, file);
else if(path.extname(config.widget) == '.md') widget = marked(widget);
else if(path.extname(config.widget) == '.md') widget = marked.parse(widget);

var description = fs.readFileSync(file.base + '/' + path.dirname(file.relative) + '/' + config.en).toString(); //TODO: other languages
if(path.extname(config.en) == '.html') description = formatHTML(description, file);
else if(path.extname(config.en) == '.md') description = marked(description);
else if(path.extname(config.en) == '.md') description = marked.parse(description);

var template = handlebars.compile(fs.readFileSync("src/layouts/example.html", "utf-8"));
var body = template({
Expand Down
Loading

0 comments on commit 263c33f

Please sign in to comment.