Move dynamically written uppy stats to theme config so we can git ignore it /cc @arturi @hedgerh

This commit is contained in:
Kevin van Zonneveld 2016-01-28 09:50:14 +01:00
parent bf3bab7593
commit 8920458d57
4 changed files with 8 additions and 14 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@ website/src/_drafts
website/themes/uppy/source/uppy/
npm-debug.log*
website/themes/uppy/_config.yml

View file

@ -2,13 +2,6 @@
## Docs: http://zespia.tw/hexo/docs/configuration.html
## Source: https://github.com/tommy351/hexo/
# Uppy versions, auto updated by update.js
uppy_version: 0.0.1
uppy_dev_size: "89.87"
uppy_min_size: "89.87"
uppy_gz_size: "89.87"
# Theme
google_analytics: UA-63083-12
root_domain: uppy.io

View file

@ -1,5 +0,0 @@
node_sass:
debug: false
outputStyle: compressed
precision: 5
sourceComments: false

View file

@ -5,9 +5,14 @@ var chalk = require('chalk')
var webRoot = __dirname
var uppyRoot = path.dirname(__dirname)
var configPath = webRoot + '/_config.yml'
var config = fs.readFileSync(configPath, 'utf-8')
var configPath = webRoot + '/themes/uppy/_config.yml'
var version = require(uppyRoot + '/package.json').version
var config
try {
config = fs.readFileSync(configPath, 'utf-8')
} catch (e) {
config = '# Uppy versions, auto updated by update.js\nuppy_version: 0.0.1\n\nuppy_dev_size: "0.0"\nuppy_min_size: "0.0"\nuppy_gz_size: "0.0"'
}
// Inject current Uppy version and sizes in website's _config.yml
var sizes = {}