Merge pull request #155 from nunocoracao/138-update-the-preferred-installation-method-in-docs

changed preferred installation method
This commit is contained in:
Nuno Coração 2022-10-23 22:28:53 +01:00 committed by GitHub
commit fc7e02a6fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 31 deletions

View file

@ -51,9 +51,34 @@ Blowfish has [extensive documentation](https://nunocoracao.github.io/blowfish/do
## Installation ## Installation
Blowfish supports several installation methods - as a Hugo Module (easiest), a git submodule, or as a completely manual install. Blowfish supports several installation methods - as a git submodule, a Hugo Module, or as a completely manual install.
Detailed instructions for each method can be found in the [Installation](https://nunocoracao.github.io/blowfish/docs/installation) docs. You should consult the documentation for the simplest setup experience. Below is a quick start guide using Hugo modules if you're already confident installing Hugo themes. Detailed instructions for each method can be found in the [Installation](https://nunocoracao.github.io/blowfish/docs/installation) docs. You should consult the documentation for the simplest setup experience. Below is a quick start guide using submodules if you are using git, or Hugo modules if you're already confident installing Hugo themes.
### Quick start using git submodules
> **Note:** Ensure you have **git**, **Go**, and **Hugo** installed, and that you have created a new Hugo project before proceeding.
1. From your project directory, initialise git:
```shell
git init
```
2. Configure Blowfish as a git submodule:
```shell
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
3. In the root folder of your website, delete the `config.toml` file that was generated by Hugo. Copy the `*.toml` config files from the theme into your `config/_default/` folder.
> **Note:** Do not overwrite the `module.toml` file you created above!
You will find these theme config files in the Hugo cache directory, or [download a copy](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/nunocoracao/blowfish/tree/main/config/_default) from GitHub.
4. Follow the [Getting Started](https://nunocoracao.github.io/blowfish/docs/getting-started/) instructions to configure your website.
### Quick start using Hugo ### Quick start using Hugo

View file

@ -37,15 +37,29 @@ Note that you can name the project directory whatever you choose, but the instru
There several different ways to install the Blowfish theme into your Hugo website. From easiest to most difficult to install and maintain, they are: There several different ways to install the Blowfish theme into your Hugo website. From easiest to most difficult to install and maintain, they are:
- [Hugo module](#install-using-hugo) (recommended) - [Git submodule](#install-using-git) (recommended)
- [Git submodule](#install-using-git) - [Hugo module](#install-using-hugo)
- [Manual file copy](#install-manually) - [Manual file copy](#install-manually)
If you're unsure, choose the Hugo module method. If you're unsure, choose the Git submodule method.
#### Install using git
This method is the quickest and easiest for keeping the theme up-to-date. Besides **Hugo** and **Go**, you'll also need to ensure you have **Git** installed on your local machine.
Change into the directory for your Hugo website (that you created above), initialise a new `git` repository and add Blowfish as a submodule.
```bash
cd mywebsite
git init
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
Then continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install using Hugo #### Install using Hugo
This method is the quickest and easiest for keeping the theme up-to-date. Hugo uses **Go** to initialise and manage modules so you need to ensure you have `go` installed before proceeding. For this method you'll use Hugo to manage your themes. Hugo uses **Go** to initialise and manage modules so you need to ensure you have `go` installed before proceeding.
1. [Download](https://golang.org/dl/) and install Go. You can check if it's already installed by using the command `go version`. 1. [Download](https://golang.org/dl/) and install Go. You can check if it's already installed by using the command `go version`.
@ -73,20 +87,6 @@ This method is the quickest and easiest for keeping the theme up-to-date. Hugo u
4. Start your server using `hugo server` and the theme will be downloaded automatically. 4. Start your server using `hugo server` and the theme will be downloaded automatically.
5. Continue to [set up the theme configuration files](#set-up-theme-configuration-files). 5. Continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install using git
For this method you'll need to ensure you have **Git** installed on your local machine.
Change into the directory for your Hugo website (that you created above), initialise a new `git` repository and add Blowfish as a submodule.
```bash
cd mywebsite
git init
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
```
Then continue to [set up the theme configuration files](#set-up-theme-configuration-files).
#### Install manually #### Install manually
1. Download the latest release of the theme source code. 1. Download the latest release of the theme source code.
@ -136,10 +136,20 @@ From time to time there will be [new releases](https://github.com/nunocoracao/bl
How you go about this will depend on the installation method you chose when the theme was originally installed. Instructions for each method can be found below. How you go about this will depend on the installation method you chose when the theme was originally installed. Instructions for each method can be found below.
- [Hugo module](#update-using-hugo)
- [Git submodule](#update-using-git) - [Git submodule](#update-using-git)
- [Hugo module](#update-using-hugo)
- [Manual file copy](#update-manually) - [Manual file copy](#update-manually)
### Update using git
Git submodules can be updated using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
```shell
git submodule update --remote --merge
```
Once the submodule has been updated, rebuild your site and check everything works as expected.
### Update using Hugo ### Update using Hugo
Hugo makes updating modules super easy. Simply change into your project directory and execute the following command: Hugo makes updating modules super easy. Simply change into your project directory and execute the following command:
@ -152,16 +162,6 @@ Hugo will automatically update any modules that are required for your project. I
Then simply rebuild your site and check everything works as expected. Then simply rebuild your site and check everything works as expected.
### Update using git
Git submodules can be updated using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
```shell
git submodule update --remote --merge
```
Once the submodule has been updated, rebuild your site and check everything works as expected.
### Update manually ### Update manually
Updating Blowfish manually requires you to download the latest copy of the theme and replace the old version in your project. Updating Blowfish manually requires you to download the latest copy of the theme and replace the old version in your project.