Make {version} placeholder consistent with handlebars

This commit is contained in:
Cory LaViska
2017-08-09 13:20:55 -04:00
parent e60d75fe93
commit c470220017
6 changed files with 15 additions and 12 deletions

View File

@@ -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)
);
});

View File

@@ -1,5 +1,5 @@
/*!
Shoelace.css {version}
Shoelace.css {{version}}
(c) A Beautiful Site, LLC
Released under the MIT license

View File

@@ -15,13 +15,13 @@ To make certain components interactive (e.g. dropdowns and tabs), youll need
The easiest way to use Shoelace is via CDN. Just add this to your `<head>`:
```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/{version}/shoelace.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/{{version}}/shoelace.css">
```
And this before `</body>` but after jQuery/Zepto:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/{version}/shoelace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/{{version}}/shoelace.js"></script>
```
This service is provided free, courtesy of [CDNJS](https://cdnjs.com/). New releases can take up to 12 hours to appear on the CDN.

View File

@@ -1,5 +1,5 @@
/*!
Shoelace.css dropdowns {version}
Shoelace.css dropdowns {{version}}
(c) A Beautiful Site, LLC
Released under the MIT license

View File

@@ -1,5 +1,5 @@
/*!
Shoelace.css tabs {version}
Shoelace.css tabs {{version}}
(c) A Beautiful Site, LLC
Released under the MIT license

View File

@@ -58,7 +58,7 @@
<img src="../source/img/wordmark.svg" alt="Shoelace logo">
</a>
<p class="text-small text-muted">
Shoelace.css {version} &middot;
Shoelace.css {{version}} &middot;
&copy; A Beautiful Site, LLC
</p>