diff --git a/gulpfile.js b/gulpfile.js
index 1a151f781..da6526075 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -20,9 +20,12 @@ const gulp = require('gulp'),
fs = require('fs'),
path = require('path'),
YAML = require('yaml'),
+ yargs = require('yargs/yargs'),
cp = require('child_process'),
pkg = require('./package.json'),
- year = new Date().getFullYear();
+ year = new Date().getFullYear(),
+ argv = yargs(process.argv).argv;
+
let BUILD = false,
distDir = './.tmp',
@@ -233,7 +236,13 @@ gulp.task('watch-jekyll', (cb) => {
*/
gulp.task('build-jekyll', (cb) => {
var env = Object.create(process.env);
- env.JEKYLL_ENV = 'production';
+
+ if(argv.preview) {
+ env.JEKYLL_ENV = 'preview';
+ }
+ else {
+ env.JEKYLL_ENV = 'production';
+ }
return spawn('bundle', ['exec', 'jekyll', 'build', '--destination', demoDir, '--trace'], { env: env, stdio: 'inherit' })
.on('close', cb);
diff --git a/package.json b/package.json
index 64b8cf18c..abd147612 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,7 @@
"scripts": {
"start": "gulp start",
"build": "gulp build",
+ "preview": "gulp build --preview",
"svg-optimize": "svgo -f svg/brand --pretty",
"unused-files": "node build/unused-files.js",
"release": "release-it",
@@ -69,7 +70,8 @@
"rollup-plugin-babel": "^4.4.0",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
- "yaml": "^1.10.0"
+ "yaml": "^1.10.0",
+ "yargs": "^16.1.0"
},
"dependencies": {
"@fullcalendar/core": "^5.3.1",
diff --git a/src/pages/_includes/cards/icons.html b/src/pages/_includes/cards/icons.html
index c330e2193..b915e2a22 100644
--- a/src/pages/_includes/cards/icons.html
+++ b/src/pages/_includes/cards/icons.html
@@ -1,6 +1,6 @@
{% assign icons = include.icons %}
{% assign limit = 20 %}
-{% if jekyll.environment == 'production' %}
+{% if jekyll.environment != 'development' %}
{% assign limit = null %}
{% endif %}
diff --git a/src/pages/_includes/layout/analytics.html b/src/pages/_includes/layout/analytics.html
index 25406842a..fc4c0feba 100644
--- a/src/pages/_includes/layout/analytics.html
+++ b/src/pages/_includes/layout/analytics.html
@@ -1,8 +1,8 @@
-
+
\ No newline at end of file
diff --git a/src/pages/_includes/layout/css.html b/src/pages/_includes/layout/css.html
index e4a8f40d9..2d4627cf3 100644
--- a/src/pages/_includes/layout/css.html
+++ b/src/pages/_includes/layout/css.html
@@ -9,16 +9,16 @@
{% for lib in site.data.libs.css %}
{% if libs contains lib[0] %}
{% for file in lib[1] %}
-
+
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
-
+
{% for plugin in site.tabler-plugins %}
-
+
{% endfor %}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/pages/_includes/layout/js.html b/src/pages/_includes/layout/js.html
index 2a9e7af8f..8ae6f4ac4 100644
--- a/src/pages/_includes/layout/js.html
+++ b/src/pages/_includes/layout/js.html
@@ -4,14 +4,14 @@
{% for lib in site.data.libs.js %}
{% if libs contains lib[0] or site.data.libs.global-libs contains lib[0] %}
{% for file in lib[1] %}
-
+
{% endfor %}
{% endif %}
{% endfor %}
-
+
{% removeemptylines %}
diff --git a/src/pages/_layouts/base.html b/src/pages/_layouts/base.html
index 384583b03..4ec7af15e 100644
--- a/src/pages/_layouts/base.html
+++ b/src/pages/_layouts/base.html
@@ -3,13 +3,17 @@
{% assign title = page.title | default: layout.title %}
+ {% if jekyll.environment == 'preview' %}
+ {% include layout/analytics.html %}
+ {% endif %}
+
{% if title %}{{ title }} - {% endif %}{% if site.title %}{{ site.title }} - {% endif %}{{ site.description }}
- {% if jekyll.environment == 'production' %}
+ {% if jekyll.environment != 'development' %}
@@ -25,10 +29,6 @@
- {% if site.preview %}
- {% include layout/analytics.html %}
- {% endif %}
-
{% if page.description %}
{% endif %}
@@ -37,7 +37,6 @@
{% endif %}
{% include layout/css.html %}
-