<p>This plugin automatically generates thumbnails for any images in your Lektor content. The difference between this plugin and the `thumbnail` filter is that this is geared towards content, i.e. you don't need to have any references to the images in your templates at all.<p>
<li><p><aclass="github-button"href="https://github.com/skorokithakis/lektor-thumbnail-generator/"data-icon="octicon-star"data-size="large"data-show-count="true"aria-label="Star lektor-thumbnail-generator on GitHub"target="_blank">Star</a></p></li>
<p>If you have trouble, see the <ahref="https://www.getlektor.com/docs/plugins/"rel="nofollow">plugin
installation</a> section of the Lektor
documentation.</p>
<p>Then, create a config file called <code>configs/thumbnail-generator.ini</code> and add
a few sections for images. The section names can be whatever you want, the
final images will be called <code>imagename-sectionname.ext</code>. For example, this
config file:</p>
<pre><code>[small]
max_width = 30
[medium]
max_width = 400
max_height = 400
[woowee]
max_width = 2000
</code></pre>
<p>Will take a file called <code>cat.jpg</code> and create the files <code>cat-small.jpg</code>,
<code>cat-medium.jpg</code> and <code>cat-woowee.jpg</code>. All the files will be created, regardless
of whether the original file is smaller, so you can link without worrying
whether a file will exist or not. If the original file is smaller than the width
you have specified, the file will only be copied, and will not be resized.
The <code>max_width</code>/<code>max_height</code> parameters work like for the <ahref="https://www.getlektor.com/docs/api/db/record/thumbnail/"rel="nofollow">Lektor
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/plugins/lektor-thumbnail-generator/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>
</div>
<divclass="col-sm-8">
<ahref="../../license/">License & Copyright</a> •
<ahref="../../contact/">Contact</a> •
Made with <iclass="fa fa-fw fa-heart"title="Heart"><spanhidden>Heart</span></i> in Carinthia