mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Merge commit '3c0036805d64fdd8290f1c4a31371780ff3ea365'
This commit is contained in:
@@ -125,17 +125,31 @@ Text
|
||||
PlainText
|
||||
: The plain variant of the above.
|
||||
|
||||
A Markdown example for an inline-style link with title:
|
||||
#### Link with title Markdown example :
|
||||
|
||||
```md
|
||||
[Text](https://www.gohugo.io "Title")
|
||||
```
|
||||
|
||||
A very simple template example given the above:
|
||||
Here is a code example for how the render-link.html template could look:
|
||||
|
||||
{{< code file="layouts/_default/_markup/render-link.html" >}}
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text }}</a>
|
||||
{{< /code >}}
|
||||
|
||||
#### Image Markdown example:
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
|
||||
Here is a code example for how the render-image.html template could look:
|
||||
|
||||
{{< code file="layouts/_default/_markup/render-image.html" >}}
|
||||
<p class="md__image">
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
||||
</p>
|
||||
{{< /code >}}
|
||||
|
||||
[^hooktemplate]: It's currently only possible to have one set of render hook templates, e.g. not per `Type` or `Section`. We may consider that in a future version.
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ baseURL
|
||||
: Hostname (and path) to the root, e.g. https://bep.is/
|
||||
|
||||
blackfriday
|
||||
: See [Configure Blackfriday](/getting-started/configuration/#configure-blackfriday)
|
||||
: See [Configure Blackfriday](/getting-started/configuration-markup#blackfriday)
|
||||
|
||||
buildDrafts (false)
|
||||
: Include drafts when building.
|
||||
|
||||
@@ -54,15 +54,15 @@ brew install hugo
|
||||
|
||||
For more detailed explanations, read the installation guides that follow for installing on macOS and Windows.
|
||||
|
||||
### Linuxbrew (Linux)
|
||||
### Homebrew (Linux)
|
||||
|
||||
If you are on Linux and using [Linuxbrew][linuxbrew], you can install Hugo with the following one-liner:
|
||||
If you are using [Homebrew][linuxbrew] on Linux, you can install Hugo with the following one-liner:
|
||||
|
||||
{{< code file="install-with-linuxbrew.sh" >}}
|
||||
brew install hugo
|
||||
{{< /code >}}
|
||||
|
||||
Installation guides for Linuxbrew are available on their [website][linuxbrew].
|
||||
Installation guides for Homebrew on Linux are available on their [website][linuxbrew].
|
||||
|
||||
### Chocolatey (Windows)
|
||||
|
||||
@@ -518,7 +518,7 @@ Now that you've installed Hugo, read the [Quick Start guide][quickstart] and exp
|
||||
[highlight shortcode]: /content-management/shortcodes/#highlight
|
||||
[installgit]: https://git-scm.com/
|
||||
[installgo]: https://golang.org/dl/
|
||||
[linuxbrew]: https://linuxbrew.sh/
|
||||
[linuxbrew]: https://docs.brew.sh/Homebrew-on-Linux
|
||||
[Path Editor]: https://patheditor2.codeplex.com/
|
||||
[pygments]: http://pygments.org
|
||||
[quickstart]: /getting-started/quick-start/
|
||||
|
||||
@@ -203,23 +203,6 @@ Since Hugo generates a static website, your site can be hosted *anywhere* using
|
||||
Running `hugo` *does not* remove generated files before building. This means that you should delete your `public/` directory (or the publish directory you specified via flag or configuration file) before running the `hugo` command. If you do not remove these files, you run the risk of the wrong files (e.g., drafts or future posts) being left in the generated site.
|
||||
{{% /warning %}}
|
||||
|
||||
### Dev vs Deploy Destinations
|
||||
|
||||
Hugo does not remove generated files before building. An easy workaround is to use different directories for development and production.
|
||||
|
||||
To start a server that builds draft content (helpful for editing), you can specify a different destination; e.g., a `dev/` directory:
|
||||
|
||||
```
|
||||
hugo server -wDs ~/Code/hugo/docs -d dev
|
||||
```
|
||||
|
||||
When the content is ready for publishing, use the default `public/` dir:
|
||||
|
||||
```
|
||||
hugo -s ~/Code/hugo/docs
|
||||
```
|
||||
|
||||
This prevents draft content from accidentally becoming available.
|
||||
|
||||
[commands]: /commands/
|
||||
[config]: /getting-started/configuration/
|
||||
|
||||
Reference in New Issue
Block a user