From e3ad11e98d14bdb9b70c475572683e9ae3730f8f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 1 Jun 2018 22:42:43 +0100 Subject: [PATCH] Fix syntax highlighting --- package.json | 1 + source/_layouts/default.html.twig | 1 + ...18-02-05-using-tailwind-css-in-your-drupal-theme.md | 4 ++-- webpack.mix.js | 6 +++++- yarn.lock | 10 ++++++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1bc7281f..b8517690 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "cross-env": "^5.1.5", "font-awesome": "^4.7.0", "highlightjs": "^9.10.0", + "jquery.2": "^1.0.0", "laravel-mix": "^2.1.11", "laravel-mix-purgecss": "^2.1.2", "laravel-mix-tailwind": "^0.1.0" diff --git a/source/_layouts/default.html.twig b/source/_layouts/default.html.twig index 1e9985f8..c6bade17 100644 --- a/source/_layouts/default.html.twig +++ b/source/_layouts/default.html.twig @@ -161,6 +161,7 @@ {% endif %} + {% block scripts %}{% endblock %} diff --git a/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md b/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md index 3037f6ea..36ff6f6e 100644 --- a/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md +++ b/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md @@ -32,7 +32,7 @@ The installation and configuration steps are essentially the same as those outli Create a `postcss.config.js` file and add `tailwindcss` as a plugin, passing the path to the config file: -```language-json +```language-js module.exports = { plugins: [ require('tailwindcss')('./tailwind.js'), @@ -44,7 +44,7 @@ module.exports = { There are some configuration settings within `tailwind.js` that you’ll need to change to make things work nicely with Drupal. These are within the `options` section: -```language-json +```language-js options: { prefix: 'tw-', important: true, diff --git a/webpack.mix.js b/webpack.mix.js index ceb49161..56fda1f0 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -5,7 +5,11 @@ require('laravel-mix-tailwind'); mix.disableNotifications() .less('assets/less/site.less', 'source/build/css') - .js('assets/js/site.js', 'source/build/js') + .combine([ + 'node_modules/jquery/dist/jquery.js', + 'node_modules/highlightjs/highlight.pack.js', + 'assets/js/site.js', + ], 'source/build/js/all.js') .copyDirectory('assets/images', 'source/build/images') .copyDirectory('node_modules/font-awesome/fonts', 'source/build/fonts') .tailwind() diff --git a/yarn.lock b/yarn.lock index 7cb44498..0aa7a8fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4178,6 +4178,16 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" +jquery.2@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/jquery.2/-/jquery.2-1.0.0.tgz#a8995f96fb804c335d08b90a57ec47db0faae6f8" + dependencies: + jquery "^2.0" + +jquery@^2.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02" + js-base64@^2.1.8, js-base64@^2.1.9: version "2.4.5" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92"