diff --git a/scripts/build.js b/scripts/build.js index c651824..3c97a14 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -4,6 +4,7 @@ import imagemin from 'imagemin'; import imageminPngquant from 'imagemin-pngquant'; import replace from 'replace-in-file'; import fs from 'fs-extra'; +import pkg from "../package.json" assert { type: 'json' }; fs.mkdirp('./tmp/assets'); fs.emptyDirSync('./tmp/assets'); @@ -36,10 +37,12 @@ fs.emptyDirSync('./tmp/assets'); }); fs.readFile('./src/starline.html', 'utf8', function(err, contents) { + const versionTag = `
${pkg.version}
`; + replace.sync({ files: './tmp/starline-card.js', from: '{%html%}', - to: contents, + to: versionTag + contents, }); fs.copySync('./tmp/starline-card.js', './dist/starline-card.js'); diff --git a/src/starline.sass b/src/starline.sass index 8bab79a..22b6ad3 100644 --- a/src/starline.sass +++ b/src/starline.sass @@ -4,6 +4,14 @@ @import 'styles/controls' @import 'styles/icons' +.version + position: absolute + bottom: 5px + right: 5px + opacity: .3 + font-size: .7em + line-height: .7em + .wrapper overflow: hidden position: relative