diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 4d175ba46..33dfdc297 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -17,6 +17,9 @@ module.exports = { } }, serviceWorker: true, + head: [ + ['link', { rel: 'icon', href: '/favicon.png' }], + ], theme: 'vue', themeConfig: { repo: 'vuejs/vue-cli', diff --git a/docs/.vuepress/public/logo.png b/docs/.vuepress/public/favicon.png similarity index 100% rename from docs/.vuepress/public/logo.png rename to docs/.vuepress/public/favicon.png diff --git a/docs/README.md b/docs/README.md index 25ab320ca..9d6c370f4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: /logo.png +heroImage: /favicon.png actionText: Get Started → actionLink: /guide/ footer: MIT Licensed | Copyright © 2018-present Evan You diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index 052aafa29..eda245f38 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -58,10 +58,10 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser set -e # build - npm run docs:build + npm run build # navigate into the build output directory - cd docs/.vuepress/dist + cd dist # if you are deploying to a custom domain # echo 'www.example.com' > CNAME @@ -273,3 +273,36 @@ Then cd into the `dist/` folder of your project and then run `surge` and follow ``` Verify your project is successfully published by Surge by visiting `myawesomeproject.surge.sh`, vola! For more setup details such as custom domains, you can visit [Surge's help page](https://surge.sh/help/). + +### Bitbucket Cloud + +1. As described in the [Bitbucket documentation](https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html) you need to create a repository named exactly `.bitbucket.io`. + +2. It is possible to publish to a subfolder of the main repository, for instance if you want to have multiple websites. In that case set correct `baseUrl` in `vue.config.js`. + + If you are deploying to `https://.bitbucket.io/`, you can omit `baseUrl` as it defaults to `"/"`. + + If you are deploying to `https://.bitbucket.io//`, set `baseUrl` to `"//"`. In this case the directory structure of the repository should reflect the url structure, for instance the repository should have a `/` directory. + +3. Inside your project, create `deploy.sh` with the following content and run it to deploy: + + ``` bash{13,20,23} + #!/usr/bin/env sh + + # abort on errors + set -e + + # build + npm run build + + # navigate into the build output directory + cd dist + + git init + git add -A + git commit -m 'deploy' + + git push -f git@bitbucket.org:/.bitbucket.io.git master + + cd - + ``` diff --git a/docs/guide/webpack.md b/docs/guide/webpack.md index b765860b8..28443ce0a 100644 --- a/docs/guide/webpack.md +++ b/docs/guide/webpack.md @@ -123,7 +123,7 @@ module.exports = { } ``` -You will need to familiarize yourself with [webpack-chain's API](https://github.com/mozilla-neutrino/webpack-chain#getting-started) and [read some source code](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config) in order to understand how to leverage the full power of this option, but it gives you a more expressive and safer way to modify the webpack config than directly mutation values. +You will need to familiarize yourself with [webpack-chain's API](https://github.com/mozilla-neutrino/webpack-chain#getting-started) and [read some source code](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config) in order to understand how to leverage the full power of this option, but it gives you a more expressive and safer way to modify the webpack config than directly mutate values. For example, say you want to change the default location of `index.html` from `/Users/username/proj/public/index.html` to `/Users/username/proj/app/templates/index.html`. By referencing [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin#options) you can see a list of options you can pass in. To change our template path we can pass in a new template path with the following config: @@ -182,7 +182,7 @@ vue inspect --plugins ## Using Resolved Config as a File -Some external tools may need access to the resolved webpack config as a file, for example IDEs or command line tools that expects a webpack config path. In that case you can use the following path: +Some external tools may need access to the resolved webpack config as a file, for example IDEs or command line tools that expect a webpack config path. In that case you can use the following path: ``` /node_modules/@vue/cli-service/webpack.config.js diff --git a/docs/ru/README.md b/docs/ru/README.md index 0d0176f32..1815f27fc 100644 --- a/docs/ru/README.md +++ b/docs/ru/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: /logo.png +heroImage: /favicon.png actionText: Введение → actionLink: /ru/guide/ footer: MIT Licensed | Copyright © 2018-present Evan You diff --git a/docs/ru/guide/build-targets.md b/docs/ru/guide/build-targets.md index 68feea06d..72c07b586 100644 --- a/docs/ru/guide/build-targets.md +++ b/docs/ru/guide/build-targets.md @@ -8,7 +8,7 @@ - `index.html` с внедрением ресурсов и подсказок для пред-загрузки - сторонние библиотеки разделяются на отдельные фрагменты для лучшего кэширования -- статические ресурсы менее 10КБайт будут вставлены инлайн в JavaScript +- статические ресурсы менее 4 КБайт будут вставлены инлайн в JavaScript - статические ресурсы в `public` будут скопированы в каталог сборки ## Библиотека (Library) diff --git a/docs/ru/guide/deployment.md b/docs/ru/guide/deployment.md index 398bf75ba..aab6712e3 100644 --- a/docs/ru/guide/deployment.md +++ b/docs/ru/guide/deployment.md @@ -273,3 +273,36 @@ npm install --global surge ``` Убедитесь, что ваш проект успешно опубликован с помощью Surge открыв в браузере `myawesomeproject.surge.sh`! Дополнительные сведения о настройке, такие как конфигурация пользовательских доменов, можно найти на [странице справки Surge](https://surge.sh/help/). + +### Bitbucket Cloud + +1. Как описывается в [документации Bitbucket](https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html) вам необходимо создать репозиторий названный в точности `.bitbucket.io`. + +2. Возможно публиковать в подкаталог, например, если требуется иметь несколько веб-сайтов. В этом случае укажите корректный `baseUrl` в файле `vue.config.js`. + + Если публикуете по адресу `https://.bitbucket.io/`, установку `baseUrl` можно опустить, поскольку значение по умолчанию `"/"`. + + Если публикуете по адресу `https://.bitbucket.io//`, нужно задать `baseUrl` в значение `"//"`. В этом случае структура каталогов должна отражать структуру URL-адресов, например, репозиторий должен иметь каталог `/`. + +3. В проекте создайте `deploy.sh` с указанным содержимым и запустите его для публикации: + + ``` bash{13,20,23} + #!/usr/bin/env sh + + # остановиться при ошибках + set -e + + # сборка + npm run build + + # переход в каталог итоговой сборки + cd dist + + git init + git add -A + git commit -m 'deploy' + + git push -f git@bitbucket.org:/.bitbucket.io.git master + + cd - + ``` diff --git a/docs/zh/README.md b/docs/zh/README.md index 3a5884c68..27b3fc722 100644 --- a/docs/zh/README.md +++ b/docs/zh/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: /logo.png +heroImage: /favicon.png actionText: 起步 → actionLink: /zh/guide/ features: