Merge pull request #172 from Jossnaz/fix-image-access

/content/docs/templates/imageops fix .query to .get
This commit is contained in:
Joseph Nix 2017-12-22 16:36:20 -06:00 committed by GitHub
commit 7041c1e1c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ the query. For instance this iterates over all attached images of a page:
To access images from a different content folder, you would use: To access images from a different content folder, you would use:
```html+jinja ```html+jinja
{% for image in site.query('/myfolder').attachments.images %} {% for image in site.get('/myfolder').attachments.images %}
<div class="image"><img src="{{ image|url }}"></div> <div class="image"><img src="{{ image|url }}"></div>
{% endfor %} {% endfor %}
``` ```
@ -35,7 +35,7 @@ To access images from a different content folder, you would use:
To retrieve only a specific image or attachment with a certain name you would use To retrieve only a specific image or attachment with a certain name you would use
```html+jinja ```html+jinja
{% set my_image site.query('/myfolder').attachments.get('imagenameexample.jpg') %} {% set my_image site.get('/myfolder').attachments.get('imagenameexample.jpg') %}
<div class="image"><img src="{{ my_image|url }}"></div> <div class="image"><img src="{{ my_image|url }}"></div>
``` ```