2020-07-06 18:55:32 +00:00
|
|
|
---
|
2021-05-23 20:42:47 +00:00
|
|
|
title: Post with images
|
2020-07-06 18:55:32 +00:00
|
|
|
date: 2020-06-22T20:00:00+02:00
|
|
|
|
authors:
|
2020-07-22 08:51:13 +00:00
|
|
|
- john-doe
|
2020-07-06 18:55:32 +00:00
|
|
|
tags:
|
2021-05-23 20:42:47 +00:00
|
|
|
- Documentation
|
|
|
|
- Shortcodes
|
2020-07-27 18:17:55 +00:00
|
|
|
resources:
|
2021-02-21 12:45:21 +00:00
|
|
|
- name: feature
|
|
|
|
src: "images/feature.jpg"
|
|
|
|
params:
|
|
|
|
credits: "[Angelina Litvin](https://unsplash.com/@linalitvina) on [Unsplash](https://unsplash.com/s/photos/writing)"
|
2021-05-23 20:42:47 +00:00
|
|
|
- name: forest-1
|
|
|
|
src: "images/forest-1.jpg"
|
|
|
|
title: Forest (1)
|
2020-07-27 18:17:55 +00:00
|
|
|
params:
|
2021-05-23 20:42:47 +00:00
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-2
|
|
|
|
src: "images/forest-2.jpg"
|
|
|
|
title: Forest (2)
|
|
|
|
params:
|
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-3
|
|
|
|
src: "images/forest-3.jpg"
|
|
|
|
title: Forest (3)
|
|
|
|
params:
|
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-4
|
|
|
|
src: "images/forest-4.jpg"
|
|
|
|
title: Forest (4)
|
|
|
|
params:
|
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-5
|
|
|
|
src: "images/forest-5.jpg"
|
|
|
|
title: Forest (5)
|
|
|
|
params:
|
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-6
|
|
|
|
src: "images/forest-6.jpg"
|
|
|
|
title: Forest (6)
|
|
|
|
params:
|
|
|
|
credits: "[Asher Ward](https://unsplash.com/@the_asher_ward) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
|
|
|
- name: forest-7
|
|
|
|
src: "images/forest-7.jpg"
|
|
|
|
title: Forest (7)
|
|
|
|
params:
|
|
|
|
credits: "[Asher Ward](https://unsplash.com/@the_asher_ward) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
2022-12-21 14:43:57 +00:00
|
|
|
- name: forest-8
|
|
|
|
src: "images/forest-8.svg"
|
|
|
|
title: Forest (8)
|
|
|
|
params:
|
|
|
|
credits: "SVG Repo on [SVGRepo](https://www.svgrepo.com/svg/286078/forest)"
|
2020-07-06 18:55:32 +00:00
|
|
|
---
|
|
|
|
|
2021-02-21 13:45:41 +00:00
|
|
|
If you need more flexibility for your embedded images, you could use the `img` shortcode. It is using Hugo's
|
|
|
|
[page resources](https://gohugo.io/content-management/page-resources/) and supports lazy loading of your images.
|
2020-07-06 18:55:32 +00:00
|
|
|
|
2021-09-23 10:01:54 +00:00
|
|
|
<!--more-->
|
|
|
|
|
2022-07-11 12:27:54 +00:00
|
|
|
## Attributes
|
2020-07-27 18:17:55 +00:00
|
|
|
|
2023-12-02 18:59:14 +00:00
|
|
|
| Name | Description | default |
|
|
|
|
| ------ | -------------------------------------------------------------------------------- | ----------------- |
|
|
|
|
| name | name of the image resource defined in your front matter | empty |
|
|
|
|
| alt | description for displayed image | resource `.Title` |
|
|
|
|
| size | Thumbnail size (origin\|profile\|tiny\|small\|medium\|large) | empty |
|
|
|
|
| lazy | enable or disable image lazy loading | true |
|
|
|
|
| anchor | anchor to determine the placement of the crop box (only used for `profile` size) | smart |
|
2021-02-21 13:45:41 +00:00
|
|
|
|
2022-07-11 12:27:54 +00:00
|
|
|
## Usage
|
2021-02-21 13:45:41 +00:00
|
|
|
|
|
|
|
Define your resources in the page front matter, custom parameter `params.credits` is optional.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
```md
|
|
|
|
---
|
|
|
|
resources:
|
2021-05-23 20:42:47 +00:00
|
|
|
- name: forest-1
|
|
|
|
src: "images/forest-1.jpg"
|
|
|
|
title: Forest (1)
|
2021-02-21 13:45:41 +00:00
|
|
|
params:
|
2021-05-23 20:42:47 +00:00
|
|
|
credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
|
2021-02-21 13:45:41 +00:00
|
|
|
---
|
|
|
|
|
2021-11-23 15:53:25 +00:00
|
|
|
{{</* img name="forest-1" lazy=false */>}}
|
2021-02-21 13:45:41 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
2022-07-11 12:27:54 +00:00
|
|
|
## Example
|
2021-05-23 20:42:47 +00:00
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-1" lazy=false >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-2" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-3" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-4" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-5" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-6" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-7" lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|
2022-12-21 14:43:57 +00:00
|
|
|
|
|
|
|
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates
|
|
|
|
investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts
|
|
|
|
feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious
|
|
|
|
copious quo ad. Stet probates in duo.
|
|
|
|
|
|
|
|
<!-- spellchecker-disable -->
|
|
|
|
|
|
|
|
{{< img name="forest-8" size=small lazy=true >}}
|
|
|
|
|
|
|
|
<!-- spellchecker-enable -->
|