Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_index.md « images « shortcodes « en « content « exampleSite - github.com/thegeeklab/hugo-geekdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 29d06a0409ab9f82ba09377d42c29a727aaf5b18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
title: Images
resources:
  - name: forest-1
    src: "forest-1.jpg"
    title: Forest (1)
    params:
      credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
  - name: forest-2
    src: "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: "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: "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: "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: "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: "forest-7.jpg"
    title: Forest (7)
    params:
      credits: "[Asher Ward](https://unsplash.com/@the_asher_ward) on [Unsplash](https://unsplash.com/s/photos/forest)"
---

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.

## Attributes

| 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 (profile\|tiny\|small\|medium\|large)    | empty             |
| lazy | enable or disable image lazy loading                    | true              |

## Usage

Define your resources in the page front matter, custom parameter `params.credits` is optional.

<!-- spellchecker-disable -->

```md
---
resources:
  - name: forest-1
    src: "forest-1.jpg"
    title: Forest (1)
    params:
      credits: "[Jay Mantri](https://unsplash.com/@jaymantri) on [Unsplash](https://unsplash.com/s/photos/forest)"
---

{{</* img name="forest-1" size="large" lazy=false */>}}
```

<!-- spellchecker-enable -->

## Example

<!-- 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 -->