Skip to content

Commit

Permalink
Add alt and caption support to feature image
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaluminium committed Jul 8, 2021
1 parent e09b375 commit 4a6ba0a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/built/screen.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/screen.css.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ make sure this only happens on large viewports / desktop-ish devices.
align-items: center;
overflow: hidden;
margin: 25px 0 50px;
background: color(var(--lightgrey) l(+10%));
border-radius: 3px;
}

Expand Down Expand Up @@ -2138,7 +2137,7 @@ Usage (In Ghost editor):
margin: 0;
}

.post-full-content figcaption {
figcaption {
margin: 1.0em auto 0;
color: color(var(--midgrey) l(-10%));
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
Expand Down
5 changes: 4 additions & 1 deletion page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ into the {body} of the default.hbs template --}}
(max-width: 1170px) 1170px,
2000px"
src="{{img_url feature_image size="xl"}}"
alt="{{title}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
/>
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}

Expand Down
2 changes: 1 addition & 1 deletion partials/post-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sizes="(max-width: 1000px) 400px, 700px"
src="{{img_url feature_image size="m"}}"
loading="lazy"
alt="{{title}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
/>
</a>
{{/if}}
Expand Down
5 changes: 4 additions & 1 deletion post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ into the {body} of the default.hbs template --}}
(max-width: 1170px) 1170px,
2000px"
src="{{img_url feature_image size="xl"}}"
alt="{{title}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
/>
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}

Expand Down

0 comments on commit 4a6ba0a

Please sign in to comment.