From ce6d3ea2cded127bc6cbc7d1c2169cd1113c8a82 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 15 Jan 2018 15:52:31 -0800 Subject: [PATCH] - dont destroy /dist/ when building homepage - update public path (should work this time!) - load octicons from CDN --- build/build.js | 6 ++++-- build/webpack.site.conf.js | 2 +- config/index.js | 2 +- docs/homepage/assets/scss/home.scss | 2 +- docs/homepage/home.html | 3 ++- docs/homepage/home.js | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/build.js b/build/build.js index b0b8f54..9ca4c5c 100644 --- a/build/build.js +++ b/build/build.js @@ -14,8 +14,10 @@ var spinner = ora(`building ${text}...`); spinner.start(); var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory); -rm('-rf', assetsPath); -mkdir('-p', assetsPath); +if (!utils.shouldBuildHomepage()) { + rm('-rf', assetsPath); + mkdir('-p', assetsPath); +} /** * Build the /dist/ folder diff --git a/build/webpack.site.conf.js b/build/webpack.site.conf.js index 6dd2e06..1d53b2a 100644 --- a/build/webpack.site.conf.js +++ b/build/webpack.site.conf.js @@ -19,7 +19,7 @@ module.exports = merge(baseWebpackConfig, { }, devtool: config.homepage.productionSourceMap ? '#source-map' : false, output: { - publicPath: '', + publicPath: config.homepage.assetsPublicPath, path: config.homepage.assetsRoot, filename: utils.assetsPath('js/[name].[chunkhash].js'), chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') diff --git a/config/index.js b/config/index.js index 704f734..9945b5d 100644 --- a/config/index.js +++ b/config/index.js @@ -23,7 +23,7 @@ module.exports = { entry: './docs/homepage/home.js', assetsRoot: path.resolve(__dirname, '../site'), assetsSubDirectory: '', - assetsPublicPath: '/', + assetsPublicPath: '', productionSourceMap: true } }; diff --git a/docs/homepage/assets/scss/home.scss b/docs/homepage/assets/scss/home.scss index e1ffd60..5015386 100644 --- a/docs/homepage/assets/scss/home.scss +++ b/docs/homepage/assets/scss/home.scss @@ -1,4 +1,4 @@ @import '~normalize.css'; @import 'demo'; @import 'cyan_theme'; -@import 'octicons'; \ No newline at end of file +//@import 'octicons'; \ No newline at end of file diff --git a/docs/homepage/home.html b/docs/homepage/home.html index 56af5b9..8c18408 100644 --- a/docs/homepage/home.html +++ b/docs/homepage/home.html @@ -6,6 +6,7 @@ + View on GitHub - + Read the Docs diff --git a/docs/homepage/home.js b/docs/homepage/home.js index e2f96b3..4c1d5d0 100644 --- a/docs/homepage/home.js +++ b/docs/homepage/home.js @@ -16,7 +16,7 @@ new Vue({ { title: 'Read the Docs', icon: 'octicon-book', - url: '/docs/' + url: 'docs/' }, { title: 'View on GitHub',