docs: fix format of the netlify makefile example (#785)
This commit is contained in:
parent
5144de62be
commit
392fa73eba
2 changed files with 15 additions and 10 deletions
|
@ -5,3 +5,5 @@ MD041: False
|
||||||
MD042: False
|
MD042: False
|
||||||
MD004:
|
MD004:
|
||||||
style: dash
|
style: dash
|
||||||
|
MD010:
|
||||||
|
code_blocks: False
|
||||||
|
|
|
@ -92,7 +92,6 @@ curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo
|
||||||
### Option 2: Clone the GitHub repository
|
### Option 2: Clone the GitHub repository
|
||||||
|
|
||||||
{{< hint type=note >}}
|
{{< hint type=note >}}
|
||||||
**Info**\
|
|
||||||
Keep in mind this method is not recommended and needs some extra steps to get it working.
|
Keep in mind this method is not recommended and needs some extra steps to get it working.
|
||||||
If you want to use the Theme as submodule keep in mind that your build process need to
|
If you want to use the Theme as submodule keep in mind that your build process need to
|
||||||
run the described steps as well.
|
run the described steps as well.
|
||||||
|
@ -119,12 +118,17 @@ There are several ways to deploy your site with this theme on Netlify. Regardles
|
||||||
|
|
||||||
Here are some possible solutions:
|
Here are some possible solutions:
|
||||||
|
|
||||||
**Use a Makefile:**
|
#### Use a Makefile
|
||||||
|
|
||||||
Add a Makefile to your repository to bundle the required steps.
|
Add a Makefile to your repository to bundle the required steps.
|
||||||
|
|
||||||
|
{{< hint type=important >}}
|
||||||
|
The `Makefile` is only an example. Depending on your project structure, `BASEDIR` or `THEMEDIR` may need to be adapted.
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
THEME_VERSION := v0.8.2
|
# Please change the theme version to the latest release version.
|
||||||
|
THEME_VERSION := v0.44.1
|
||||||
THEME := hugo-geekdoc
|
THEME := hugo-geekdoc
|
||||||
BASEDIR := docs
|
BASEDIR := docs
|
||||||
THEMEDIR := $(BASEDIR)/themes
|
THEMEDIR := $(BASEDIR)/themes
|
||||||
|
@ -134,17 +138,17 @@ doc: doc-assets doc-build
|
||||||
|
|
||||||
.PHONY: doc-assets
|
.PHONY: doc-assets
|
||||||
doc-assets:
|
doc-assets:
|
||||||
mkdir -p $(THEMEDIR)/$(THEME)/ ; \
|
mkdir -p $(THEMEDIR)/$(THEME)/ ; \
|
||||||
curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1
|
curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1
|
||||||
|
|
||||||
.PHONY: doc-build
|
.PHONY: doc-build
|
||||||
doc-build:
|
doc-build:
|
||||||
cd $(BASEDIR); hugo
|
cd $(BASEDIR); hugo
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(THEMEDIR) && \
|
rm -rf $(THEMEDIR) && \
|
||||||
rm -rf $(BASEDIR)/public
|
rm -rf $(BASEDIR)/public
|
||||||
```
|
```
|
||||||
|
|
||||||
This Makefile can be used in your `netlify.toml`, take a look at the [Netlify example](https://docs.netlify.com/configure-builds/file-based-configuration/#sample-netlify-toml-file) for more information:
|
This Makefile can be used in your `netlify.toml`, take a look at the [Netlify example](https://docs.netlify.com/configure-builds/file-based-configuration/#sample-netlify-toml-file) for more information:
|
||||||
|
@ -155,7 +159,7 @@ publish = "docs/public"
|
||||||
command = "make doc"
|
command = "make doc"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Chain required commands:**
|
#### Chain required commands
|
||||||
|
|
||||||
Chain all required commands to prepare the theme and build your site on the `command` option in your `netlify.toml` like this:
|
Chain all required commands to prepare the theme and build your site on the `command` option in your `netlify.toml` like this:
|
||||||
|
|
||||||
|
@ -168,7 +172,6 @@ command = "command1 && command 2 && command3 && hugo"
|
||||||
### Subdirectories
|
### Subdirectories
|
||||||
|
|
||||||
{{< hint type=important >}}
|
{{< hint type=important >}}
|
||||||
**Warning**\
|
|
||||||
As deploying Hugo sites on subdirectories is not as robust as on subdomains, we do not recommend this.
|
As deploying Hugo sites on subdirectories is not as robust as on subdomains, we do not recommend this.
|
||||||
If you have a choice, using a domain/subdomain should always be the preferred solution!
|
If you have a choice, using a domain/subdomain should always be the preferred solution!
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
Loading…
Reference in a new issue