Skip to content

Commit

Permalink
Display title and tags on product pages (#2225)
Browse files Browse the repository at this point in the history
Display a h1 title on product page. This is recommended to improve accessibility, and it gave the opportunity to display additional page metadata, such as last modified date and product tags.

Product description as been slightly modified to let the text flow around the logo. Moreover the image height attribute as been removed to scale it without distortion.
  • Loading branch information
marcwrobel committed Mar 29, 2023
1 parent e3abaa4 commit bf3f7b0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
38 changes: 27 additions & 11 deletions _layouts/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,34 @@
layout: default
---

{% if page.iconUrl %}
<img alt="{{ page.title }} logo" class=productlogo width=50 height=50 src="{{ page.iconUrl }}">
{% else %}
<img alt="No product logo" class=productlogo width=50 height=50 src="{{ '/assets/default-product-logo.svg' | relative_url }}">
{% endif %}
<div class="product-title">
<h1>{{ page.title }}</h1>

<div class="d-flex flex-justify-between align-items-center fw-300">
<time datetime="{{ page.last_modified_at | date_to_xmlschema }}">
📅 Last updated on {{ page.last_modified_at | date_to_long_string }}
{%- if page.auto %}
<span title="Latest releases on this page are automatically updated.">🤖</span>
{%- endif %}
</time>

<span class="labels">
{% for tag in page.tags %}<span class="label">{{ tag }}</span>{% endfor %}
</span>
</div>
</div>

<div class="description">{{content | extract_element:'blockquote' | first }}</div>
<div class="product-description">
{%- assign iconUrl = page.iconUrl %}
{%- assign iconDescription = page.title %}
{%- unless iconUrl %}
{%- assign iconDescription = 'No product' %}
{%- assign iconUrl = '/assets/default-product-logo.svg' | relative_url %}
{%- endunless %}
<img class="product-logo" width="50" src="{{ iconUrl }}" alt="{{ iconDescription }} logo">

{{content | extract_element:'blockquote' | first | extract_element:'p' }}
</div>

{% if page.releaseImage %}
<img alt="Release Schedule Image Gantt Chart for {{page.title}}" src="{{page.releaseImage}}" />
Expand Down Expand Up @@ -174,8 +195,3 @@
See the <a href="/docs/api/">API Documentation</a> for more information.
You can subscribe to the iCalendar feed at <a href="webcal://{{site.url | split: '://' | last}}/calendar{{page.permalink}}.ics">/calendar{{page.permalink}}.ics</a>.
</p>

<p>
This page was last updated on {{ page.last_modified_at | date_to_long_string }}.
{%if page.auto %}Latest releases are automatically updated.{% endif %}
</p>
7 changes: 6 additions & 1 deletion _sass/custom/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ a {
// Icons are 50x50, so this adds another 10 pixels
min-height: 60px;
}
.productlogo {
.product-logo {
float: left;
margin-right: .5em;
}
.bg-light {
background-color: #f8f9fa !important;
Expand Down Expand Up @@ -74,3 +75,7 @@ body {
margin-bottom: -.3rem;
}
}

.align-items-center {
align-items: center;
}

0 comments on commit bf3f7b0

Please sign in to comment.