mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 12:14:19 +00:00
Merge branch 'temp791'
This commit is contained in:
3 files changed
+34
-1
No files matched your search
@@ -21,7 +21,9 @@ the lowest page they are bundled with, and simple which names does not contain `
|
|||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
ResourceType
|
ResourceType
|
||||||
: The main type of the resource. For example, a file of MIME type `image/jpeg` has the ResourceType `image`.
|
: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
|
||||||
|
|
||||||
|
{{< new-in "0.80.0" >}} Note that we in Hugo `v0.80.0` fixed a bug where non-image resources (e.g. video) would return the MIME sub type, e.g. `json`.
|
||||||
|
|
||||||
Name
|
Name
|
||||||
: Default value is the filename (relative to the owning page). Can be set in front matter.
|
: Default value is the filename (relative to the owning page). Can be set in front matter.
|
||||||
|
|||||||
@@ -398,6 +398,13 @@ Furthermore, you can automatically start playback of the embedded video by setti
|
|||||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titles), it's best to provide a title for your YouTube video. You can do this using the shortcode by providing a `title` parameter. If no title is provided, a default of "YouTube Video" will be used.
|
||||||
|
|
||||||
|
{{< code file="example-youtube-input-with-title.md" >}}
|
||||||
|
{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
|
||||||
|
{{< /code >}}
|
||||||
|
|
||||||
|
|
||||||
#### Example `youtube` Output
|
#### Example `youtube` Output
|
||||||
|
|
||||||
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
||||||
|
|||||||
@@ -17,6 +17,30 @@ toc: true
|
|||||||
|
|
||||||
See [images.Filter](#filter) for how to apply these filters to an image.
|
See [images.Filter](#filter) for how to apply these filters to an image.
|
||||||
|
|
||||||
|
### Overlay
|
||||||
|
|
||||||
|
{{< new-in "0.80.0" >}}
|
||||||
|
|
||||||
|
{{% funcsig %}}
|
||||||
|
images.Overlay SRC X Y
|
||||||
|
{{% /funcsig %}}
|
||||||
|
|
||||||
|
Overlay creates a filter that overlays the source image at position x y, e.g:
|
||||||
|
|
||||||
|
|
||||||
|
```go-html-template
|
||||||
|
{{ $logoFilter := (images.Overlay $logo 50 50 ) }}
|
||||||
|
{{ $img := $img | images.Filter $logoFilter }}
|
||||||
|
```
|
||||||
|
|
||||||
|
A shorter version of the above, if you only need to apply the filter once:
|
||||||
|
|
||||||
|
```go-html-template
|
||||||
|
{{ $img := $img.Filter (images.Overlay $logo 50 50 )}}
|
||||||
|
```
|
||||||
|
|
||||||
|
The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
|
||||||
|
|
||||||
### Brightness
|
### Brightness
|
||||||
|
|
||||||
{{% funcsig %}}
|
{{% funcsig %}}
|
||||||
|
|||||||
Reference in new issue
Block a user