Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header alt tags #1138

Merged
merged 2 commits into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _includes/page__hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ <h1 class="page__title" itemprop="headline">
{% endif %}
</div>
{% else %}
{% if page.header.image_description %}
<img src="{{ img_path }}" alt="{{ page.header.image_description }}" class="page__hero-image">
{% else %}
<img src="{{ img_path }}" alt="{{ page.title }}" class="page__hero-image">
{% endif %}
{% endif %}
{% if page.header.caption %}
<span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
Expand Down
8 changes: 8 additions & 0 deletions docs/_docs/10-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ header:
image: http://some-site.com/assets/images/image.jpg
```

To provide a custom alt tag for screen readers:

```yaml
header:
image: /assets/images/unsplash-image-1.jpg
image_description: "A description of the image"
```

To include a caption or attribution for the image:

```yaml
Expand Down