Explorar el Código

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

Kevin van Zonneveld hace 9 años
padre
commit
8920458d57
Se han modificado 4 ficheros con 8 adiciones y 14 borrados
  1. 1 0
      .gitignore
  2. 0 7
      website/_config.yml
  3. 0 5
      website/themes/uppy/_config.yml
  4. 7 2
      website/update.js

+ 1 - 0
.gitignore

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

+ 0 - 7
website/_config.yml

@@ -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

+ 0 - 5
website/themes/uppy/_config.yml

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

+ 7 - 2
website/update.js

@@ -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 = {}