mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +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.
|
||||
|
||||
|
Reference in New Issue
Block a user