Hugo on GitHub Pages with Travis
Preparation steps
1.Install hugo on your local system.
2.Create a bot user account on GitHub.
create two repositories on Github
use two repositories: one for sources and another for publishing
publishing repositories named like <user/org name>.github.io for your HTML content,and if you hava domain,you can go to Settings fill in your Custom domain and enable Enforce HTTPS.
sources repositories named like Blog.
Put your secrets to travis settings
1.New personal access token
In your github New personal access token,Token description fill in token name and enable all about repo,then get token ,copy it.
2.Setting Travis CI
In order to get the HTML content pushed to GitHub Pages, you have to create a secret variable in the Travis CI settings of your repository, which contains hugo source files.
- Login Travis CI with github account,then you will find your github repositories in Travis.
- Turn on Blog repositories and click Settings.

- Environment Variables:Name fill in “GITHUB_TOKEN”,Value fill in your github token.
- click Add.

Revise config.toml
Create travis configuration
Create .gitignore
public/*
themes/*
resources/*