Skip to content

Commit

Permalink
docs: merge branch 'docs' into dev [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 5, 2018
2 parents 3f434f6 + e810806 commit 6f12d35
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module.exports = {
}
},
serviceWorker: true,
head: [
['link', { rel: 'icon', href: '/favicon.png' }],
],
theme: 'vue',
themeConfig: {
repo: 'vuejs/vue-cli',
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
37 changes: 35 additions & 2 deletions docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 `<USERNAME>.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://<USERNAME>.bitbucket.io/`, you can omit `baseUrl` as it defaults to `"/"`.
If you are deploying to `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, set `baseUrl` to `"/<SUBFOLDER>/"`. In this case the directory structure of the repository should reflect the url structure, for instance the repository should have a `/<SUBFOLDER>` 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:<USERNAME>/<USERNAME>.bitbucket.io.git master
cd -
```
4 changes: 2 additions & 2 deletions docs/guide/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:

```
<projectRoot>/node_modules/@vue/cli-service/webpack.config.js
Expand Down
2 changes: 1 addition & 1 deletion docs/ru/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
home: true
heroImage: /logo.png
heroImage: /favicon.png
actionText: Введение →
actionLink: /ru/guide/
footer: MIT Licensed | Copyright © 2018-present Evan You
Expand Down
2 changes: 1 addition & 1 deletion docs/ru/guide/build-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- `index.html` с внедрением ресурсов и подсказок для пред-загрузки
- сторонние библиотеки разделяются на отдельные фрагменты для лучшего кэширования
- статические ресурсы менее 10КБайт будут вставлены инлайн в JavaScript
- статические ресурсы менее 4 КБайт будут вставлены инлайн в JavaScript
- статические ресурсы в `public` будут скопированы в каталог сборки

## Библиотека (Library)
Expand Down
33 changes: 33 additions & 0 deletions docs/ru/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) вам необходимо создать репозиторий названный в точности `<USERNAME>.bitbucket.io`.

2. Возможно публиковать в подкаталог, например, если требуется иметь несколько веб-сайтов. В этом случае укажите корректный `baseUrl` в файле `vue.config.js`.

Если публикуете по адресу `https://<USERNAME>.bitbucket.io/`, установку `baseUrl` можно опустить, поскольку значение по умолчанию `"/"`.

Если публикуете по адресу `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, нужно задать `baseUrl` в значение `"/<SUBFOLDER>/"`. В этом случае структура каталогов должна отражать структуру URL-адресов, например, репозиторий должен иметь каталог `/<SUBFOLDER>`.

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:<USERNAME>/<USERNAME>.bitbucket.io.git master
cd -
```
2 changes: 1 addition & 1 deletion docs/zh/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
home: true
heroImage: /logo.png
heroImage: /favicon.png
actionText: 起步 →
actionLink: /zh/guide/
features:
Expand Down

0 comments on commit 6f12d35

Please sign in to comment.