diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 0e789a9bb..40be772a6 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,15 +1,17 @@ +const version = require('./../../package.json').version; +const isDev = process.argv[2] === 'dev'; +const devPath = 'https://localhost:8080/dist'; + module.exports = { title: 'GrapesJS', description: 'GrapesJS documentation', base: '/docs/', - ga: '', // Google Analytics ID + ga: 'UA-74284223-1', serviceWorker: false, // Enable Service Worker for offline usage head: [ ['link', { rel: 'icon', href: '/logo-icon.png' }], - //['link', { rel: 'stylesheet', href: 'https://unpkg.com/grapesjs/dist/css/grapes.min.css' }], // dev https://localhost:8080/dist/css/grapes.min.css - // ['script', { src: '/grapes.min.js' }], // dev https://localhost:8080/dist/grapes.min.js - ['link', { rel: 'stylesheet', href: 'https://localhost:8080/dist/css/grapes.min.css' }], - ['script', { src: 'https://localhost:8080/dist/grapes.min.js' }], + ['link', { rel: 'stylesheet', href: isDev ? `${devPath}/css/grapes.min.css` : `../stylesheets/grapes.min.css?v${version}` }], + ['script', { src: isDev ? `${devPath}/grapes.min.js` : `../js/grapes.min.js?v${version}` }], ], localesSKIP: { '/': { diff --git a/docs/deploy.sh b/docs/deploy.sh index 6c7278c65..6792071f1 100755 --- a/docs/deploy.sh +++ b/docs/deploy.sh @@ -16,17 +16,13 @@ mkdir docs-new mv `\ls -1 ./ | grep -v docs-new` ./docs-new # fetch the current site, remove the old docs dir and make current the new one -git clone -b gh-pages https://github.com/artf/grapesjs.git +git clone -b gh-pages https://github.com/artf/grapesjs.git tmp && mv tmp/* tmp/.* . && rm -rf tmp rm -fR docs mv ./docs-new ./docs # stage all and commit git add -A git commit -m 'deploy docs' - -# git push -f git@github.com:artf/grapesjs.git master:gh-pages -# git push -f git@github.com:artf/grapesjs.git gh-pages - -surge --domain closed-harmony.surge.sh - +git push git@github.com:artf/grapesjs.git gh-pages +# surge --domain grapesjs.surge.sh cd -