From ba5f6b6a06de3f36ecc0aaaa9bf40be503e2b321 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 2 Nov 2020 15:19:40 +0100 Subject: [PATCH] Fix missing highlightJS stylesheets This commit renames the hilightjs stylesheet to include the ".min.css" file suffix. Without that, highlightJS cannot load the custom stylesheets. Fixes gh-63 --- gulpfile.js | 15 +++++++++++++-- package.json | 2 +- ...{atom-one-light.css => atom-one-light.min.css} | 0 .../{github-gist.css => github-gist.min.css} | 0 .../styles/{github.css => github.min.css} | 0 .../styles/{googlecode.css => googlecode.min.css} | 0 ...olarized-light.css => solarized-light.min.css} | 0 7 files changed, 14 insertions(+), 3 deletions(-) rename src/main/resources/js/highlight/styles/{atom-one-light.css => atom-one-light.min.css} (100%) rename src/main/resources/js/highlight/styles/{github-gist.css => github-gist.min.css} (100%) rename src/main/resources/js/highlight/styles/{github.css => github.min.css} (100%) rename src/main/resources/js/highlight/styles/{googlecode.css => googlecode.min.css} (100%) rename src/main/resources/js/highlight/styles/{solarized-light.css => solarized-light.min.css} (100%) diff --git a/gulpfile.js b/gulpfile.js index 5294162..21d9a8b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,5 @@ const { src, dest, series, parallel, watch } = require('gulp'), + del = require('del'), gulpSass = require('gulp-sass'), asciidoctor = require('@asciidoctor/gulp-asciidoctor'), gulpConnect = require('gulp-connect'); @@ -14,6 +15,11 @@ const paths = { * Building the theme */ +// Cleans the build folder for the dev lifecycle +function clean(cb) { + del([paths.dist + '**'], cb()); +} + // Compile SASS files to build/dist/css/ function sass() { return src(paths.sass) @@ -71,6 +77,11 @@ function watchFiles(cb) { cb(); } +// cleans the build folder for the dev lifecycle +function cleanDev(cb) { + del([paths.web + '**'], cb()); +} + // Serve sample document and reload for changes function connect(cb) { gulpConnect.server({ @@ -80,7 +91,7 @@ function connect(cb) { cb(); } -const build = series(sass, copyResource); +const build = series(clean, sass, copyResource); const update = series(build, copyDist, render); exports.default = build; -exports.dev = series(update, parallel(connect, watchFiles)); \ No newline at end of file +exports.dev = series(cleanDev, update, parallel(connect, watchFiles)); \ No newline at end of file diff --git a/package.json b/package.json index 82f2ca9..5284bbd 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "version": "0.1.1", "repository": "https://github.com/spring-io/spring-doc-resources", "license": "Apache-2.0", - "dependencies": {}, "devDependencies": { "@asciidoctor/gulp-asciidoctor": "^2.2.5", + "del": "^6.0.0", "gulp": "^4.0.2", "gulp-connect": "^5.7.0", "gulp-sass": "^4.1.0", diff --git a/src/main/resources/js/highlight/styles/atom-one-light.css b/src/main/resources/js/highlight/styles/atom-one-light.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/atom-one-light.css rename to src/main/resources/js/highlight/styles/atom-one-light.min.css diff --git a/src/main/resources/js/highlight/styles/github-gist.css b/src/main/resources/js/highlight/styles/github-gist.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/github-gist.css rename to src/main/resources/js/highlight/styles/github-gist.min.css diff --git a/src/main/resources/js/highlight/styles/github.css b/src/main/resources/js/highlight/styles/github.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/github.css rename to src/main/resources/js/highlight/styles/github.min.css diff --git a/src/main/resources/js/highlight/styles/googlecode.css b/src/main/resources/js/highlight/styles/googlecode.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/googlecode.css rename to src/main/resources/js/highlight/styles/googlecode.min.css diff --git a/src/main/resources/js/highlight/styles/solarized-light.css b/src/main/resources/js/highlight/styles/solarized-light.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/solarized-light.css rename to src/main/resources/js/highlight/styles/solarized-light.min.css