From c470220017efa4f1e7ff34ac7394bae41206c465 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 9 Aug 2017 13:20:55 -0400 Subject: [PATCH] Make {version} placeholder consistent with handlebars --- build.js | 15 +++++++++------ source/css/shoelace.css | 2 +- source/docs/installing.md | 4 ++-- source/js/dropdowns.js | 2 +- source/js/tabs.js | 2 +- source/layouts/default.html | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/build.js b/build.js index 6729f8a3..07d58ea1 100644 --- a/build.js +++ b/build.js @@ -62,8 +62,8 @@ if(Program.build) { .then((styles) => new Promise((resolve, reject) => { let shoelaceCSS = Path.join(__dirname, 'dist/shoelace.css'); - // Update {version} in CSS - styles = styles.replace(/\{version\}/g, __version); + // Update {{version}} in CSS since it's not processed with Handlebars + styles = styles.replace(/\{\{version\}\}/g, __version); // Write output file FS.writeFile(shoelaceCSS, styles, 'utf8', (err) => { @@ -101,8 +101,8 @@ if(Program.build) { .then((scripts) => new Promise((resolve, reject) => { let shoelaceJS = Path.join(__dirname, 'dist/shoelace.js'); - // Update {version} in JS - scripts = scripts.replace(/\{version\}/g, __version); + // Update {{version}} in JS since it's not processed with Handlebars + scripts = scripts.replace(/\{\{version\}\}/g, __version); // Write output file FS.writeFile(shoelaceJS, scripts, 'utf8', (err) => { @@ -123,12 +123,15 @@ if(Program.build) { .destination('./docs') .clean(true) .use(Markdown()) + .metadata({ + version: __version + }) .use(Layouts({ engine: 'handlebars', directory: './source/layouts', rename: false })) - // Update {version} in content + // Update {{version}} in content since it's not processed with Handlebars .use((files, metalsmith, done) => { Object.keys(files).forEach((key) => { let file = files[key]; @@ -136,7 +139,7 @@ if(Program.build) { file.contents = new Buffer( file.contents .toString() - .replace(/\{version\}/g, __version) + .replace(/\{\{version\}\}/g, __version) ); }); diff --git a/source/css/shoelace.css b/source/css/shoelace.css index c9ef8a0e..4b96bd6d 100644 --- a/source/css/shoelace.css +++ b/source/css/shoelace.css @@ -1,5 +1,5 @@ /*! - Shoelace.css {version} + Shoelace.css {{version}} (c) A Beautiful Site, LLC Released under the MIT license diff --git a/source/docs/installing.md b/source/docs/installing.md index 15fd011a..a0d94e58 100644 --- a/source/docs/installing.md +++ b/source/docs/installing.md @@ -15,13 +15,13 @@ To make certain components interactive (e.g. dropdowns and tabs), you’ll need The easiest way to use Shoelace is via CDN. Just add this to your ``: ```html - + ``` And this before `` but after jQuery/Zepto: ```html - + ``` This service is provided free, courtesy of [CDNJS](https://cdnjs.com/). New releases can take up to 12 hours to appear on the CDN. diff --git a/source/js/dropdowns.js b/source/js/dropdowns.js index 67928551..78c2e7af 100644 --- a/source/js/dropdowns.js +++ b/source/js/dropdowns.js @@ -1,5 +1,5 @@ /*! - Shoelace.css dropdowns {version} + Shoelace.css dropdowns {{version}} (c) A Beautiful Site, LLC Released under the MIT license diff --git a/source/js/tabs.js b/source/js/tabs.js index 8839ec4a..c0128dba 100644 --- a/source/js/tabs.js +++ b/source/js/tabs.js @@ -1,5 +1,5 @@ /*! - Shoelace.css tabs {version} + Shoelace.css tabs {{version}} (c) A Beautiful Site, LLC Released under the MIT license diff --git a/source/layouts/default.html b/source/layouts/default.html index 45ac5321..b0019486 100644 --- a/source/layouts/default.html +++ b/source/layouts/default.html @@ -58,7 +58,7 @@ Shoelace logo

- Shoelace.css {version} · + Shoelace.css {{version}} · © A Beautiful Site, LLC