mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 15:58:53 +00:00
Rephrase four points from Hosting on Github docs
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
bce1b18326
commit
7bd427141d
@@ -54,15 +54,15 @@ This is a much simpler setup as your Hugo files and generated content are publis
|
||||
1. Create a `<YOUR-PROJECT>` (e.g. `blog`) repository on GitHub. This repository will contain Hugo's content and other source files.
|
||||
2. Create a `<USERNAME>.github.io` GitHub repository. This is the repository that will contain the fully rendered version of your Hugo website.
|
||||
3. `git clone <YOUR-PROJECT-URL> && cd <YOUR-PROJECT>`
|
||||
4. Make your website work locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
|
||||
4. Paste your existing Hugo project into a new local `<YOUR-PROJECT>` repository. Make sure your website works locally (`hugo server` or `hugo server -t <YOURTHEME>`) and open your browser to <http://localhost:1313>.
|
||||
5. Once you are happy with the results:
|
||||
* Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to kill the server
|
||||
* `rm -rf public` to completely remove the `public` directory
|
||||
6. `git submodule add -b master git@github.com:<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository). You can automate some of these steps with the following script.
|
||||
* Before proceeding run `rm -rf public` to completely remove the `public` directory
|
||||
6. `git submodule add -b master git@github.com:<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository).
|
||||
|
||||
### Put it Into a Script
|
||||
|
||||
You're almost done. You can also add a `deploy.sh` script to automate the preceding steps for you. You can also make it executable with `chmod +x deploy.sh`.
|
||||
You're almost done. In order to automate next steps create a `deploy.sh` script. You can also make it executable with `chmod +x deploy.sh`.
|
||||
|
||||
The following are the contents of the `deploy.sh` script:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user