The main process

1. Select Settings — Pages from the repository on Github

2. Under Source, select branches and project folders and click the Save button to Save

Note: This folder has only root and docs options, so you can specify the directory you want to export as docs

3. Displayed sites

https://github username. Github. IO/Repository name

4. The following two explanations

Theme Chooser is to select a Theme for the site, click change Theme optional,

According to the tests, this feature works if there is an index.md file in the repository (the one that is automatically generated after the repository is created) and the theme is rendered according to markdown syntax

Custom Domain Sets a Custom domain name that provides services from the Custom domain name

Problems encountered

1, folder selection

Github only provides root and docs options, so you need to set the output directory to docs or root in the repository

2, service,

The site provided by Pages is a static site with no corresponding service configuration, so you can open the entry page under the project at this site and check whether it can be accessed successfully in the form of a file. (note:)

3, update,

After the code is submitted to the repository, it is automatically deployed to the site. The deployment frequency is limited to 10 times /h. Therefore, it is recommended to push the code after the local preview is successful

4. Vue related

If the routing mode on Github is hash, set publicPath to./ Routing mode to hash

On Gitee, the routing mode is history, and the publicPath is set to/repository name/(for example, gitee.com/lyww1992/fl…

The following is an example:

publicPath:process.env.NODE_ENV === 'production'

    ? '/flexcourse/'

    : '/',
Copy the code

Using vue project tests, hash and History modes are consistent with local performance