mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 11:09:13 +00:00
Make {version} placeholder consistent with handlebars
This commit is contained in:
15
build.js
15
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)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
Shoelace.css {version}
|
||||
Shoelace.css {{version}}
|
||||
(c) A Beautiful Site, LLC
|
||||
|
||||
Released under the MIT license
|
||||
|
||||
@@ -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 `<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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
Shoelace.css dropdowns {version}
|
||||
Shoelace.css dropdowns {{version}}
|
||||
(c) A Beautiful Site, LLC
|
||||
|
||||
Released under the MIT license
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
Shoelace.css tabs {version}
|
||||
Shoelace.css tabs {{version}}
|
||||
(c) A Beautiful Site, LLC
|
||||
|
||||
Released under the MIT license
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<img src="../source/img/wordmark.svg" alt="Shoelace logo">
|
||||
</a>
|
||||
<p class="text-small text-muted">
|
||||
Shoelace.css {version} ·
|
||||
Shoelace.css {{version}} ·
|
||||
© A Beautiful Site, LLC
|
||||
</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user