Merge branch 'main' of github.com:HackmanClub/tapestry
This commit is contained in:
commit
d90f7e6b8f
1 changed files with 2 additions and 3 deletions
|
|
@ -108,17 +108,16 @@ sidebar_menu:
|
||||||
|
|
||||||
- Put post images in `source/images/`
|
- Put post images in `source/images/`
|
||||||
- The theme generates thumbnails automatically in `source/thumbnails/`
|
- The theme generates thumbnails automatically in `source/thumbnails/`
|
||||||
- Use `small-` or `large-` in templates depending on your layout.
|
|
||||||
|
|
||||||
Example in a template:
|
Example in a template:
|
||||||
|
|
||||||
```ejs
|
```ejs
|
||||||
<% if (post.photos && post.photos.length) { %>
|
<% if (post.photos && post.photos.length) { %>
|
||||||
<img class="gallery" src="<%- config.root %>thumbnails/small-<%- post.photos[0].replace(/^images\//,'') %>" alt="<%- post.title %>">
|
<img class="gallery" src="<%- config.root %>thumbnails/<%- post.photos[0].replace(/^images\//, '') %>" alt="<%- post.title || 'Untitled' %>">
|
||||||
<% } %>
|
<% } %>
|
||||||
```
|
```
|
||||||
|
|
||||||
> ⚠️ Only shows image if `post.photos` exists.
|
> ⚠️ Only shows image if `post.photos` exists, and it will only show the first image.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue