Skip to content

Commit

Permalink
Ecommerce link correction (#627)
Browse files Browse the repository at this point in the history
* Correct link reference in HTML tag

* Update last updated date

* Generate chapters

* Generate chapters

* Generate chapters

* Correct Spanish version

* Commit sitemap
  • Loading branch information
tunetheweb authored and rviscomi committed Jan 10, 2020
1 parent 34a46ce commit eaa36b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/content/en/2019/ecommerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ reviewers: [voltek62]
translators: []
discuss: 1768
published: 2019-11-11T00:00:00.000Z
last_updated: 2019-11-23T00:00:00.000Z
last_updated: 2020-01-10T00:00:00.000Z
---

## Introduction
Expand Down Expand Up @@ -438,7 +438,7 @@ We need to do more analysis to better understand why some sites are not using re
<figcaption id="fig15-caption">Figure 15. Popular image formats.</figcaption>
</figure>

<aside class="note">Note that some image services or CDNs will automatically deliver WebP (rather than JPEG or PNG) to platforms that support WebP, even for a URL with a `.jpg` or `.png` suffix. For example, [IMG_20190113_113201.jpg](https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg) returns a WebP image in Chrome. However, the way HTTP Archive [detects image formats](https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994) is to check for keywords in the MIME type first, then fall back to the file extension. This means that the format for images with URLs such as the above will be given as WebP, since WebP is supported by HTTP Archive as a user agent.</aside>
<aside class="note">Note that some image services or CDNs will automatically deliver WebP (rather than JPEG or PNG) to platforms that support WebP, even for a URL with a `.jpg` or `.png` suffix. For example, <a href="https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg">IMG_20190113_113201.jpg</a> returns a WebP image in Chrome. However, the way HTTP Archive <a href="https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994">detects image formats</a> is to check for keywords in the MIME type first, then fall back to the file extension. This means that the format for images with URLs such as the above will be given as WebP, since WebP is supported by HTTP Archive as a user agent.</aside>

### PNG

Expand Down
2 changes: 1 addition & 1 deletion src/content/es/2019/ecommerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Necesitamos hacer más análisis para comprender mejor por qué algunos sitios n
<figcaption>Figura 15. Formatos de imagen populares.</figcaption>
</figure>

<aside class="note">Tenga en cuenta que algunos servicios de imágenes o CDN entregarán automáticamente WebP (en lugar de JPEG o PNG) a plataformas que admitan WebP, incluso para una URL con el sufijo `.jpg` o` .png`. Por ejemplo, [IMG_20190113_113201.jpg](https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg) devuelve una imagen WebP en Chrome. Sin embargo, la forma en que HTTP Archive [detecta los formatos de imagen](https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994) es verificar primero las palabras clave en el tipo MIME y usar como alternativa la extensión de archivo. Esto significa que el formato para imágenes con una URL como la anterior se clasifica como WebP, ya que WebP es compatible con HTTP Archive como agente de usuario.</aside>
<aside class="note">Tenga en cuenta que algunos servicios de imágenes o CDN entregarán automáticamente WebP (en lugar de JPEG o PNG) a plataformas que admitan WebP, incluso para una URL con el sufijo `.jpg` o` .png`. Por ejemplo, <a href="https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg">IMG_20190113_113201.jpg</a> devuelve una imagen WebP en Chrome. Sin embargo, la forma en que HTTP Archive <a href="https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994">detecta los formatos de imagen</a> es verificar primero las palabras clave en el tipo MIME y usar como alternativa la extensión de archivo. Esto significa que el formato para imágenes con una URL como la anterior se clasifica como WebP, ya que WebP es compatible con HTTP Archive como agente de usuario.</aside>

### PNG

Expand Down
4 changes: 2 additions & 2 deletions src/templates/en/2019/chapters/ecommerce.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- make changes to the markdown content directly (`src/content/<lang>/<year>/<chapter>.md`) because any changes to the chapter templates will be overwritten by the generation script
#}-->

{% set metadata = {"part_number":"III","chapter_number":13,"title":"Ecommerce","description":"Ecommerce chapter of the 2019 Web Almanac covering ecommerce platforms, payloads, images, third-parties, performance, seo, and PWAs.","authors":["samdutton","alankent"],"reviewers":["voltek62"],"translators":[""],"discuss":"1768","published":"2019-11-11T00:00:00.000Z","last_updated":"2019-11-23T00:00:00.000Z"} %} {% set chapter_image_dir = ("/static/images/2019/%s" % get_chapter_image_dir(metadata)) %} {% block description %}{{ metadata.get('description',metadata.get('title') + ' chapter of the ' + year + ' Web Almanac probing into the use of ' + metadata.get('description',metadata.get('title')) + ' on the web.') }}{% endblock %} {% block meta %}
{% set metadata = {"part_number":"III","chapter_number":13,"title":"Ecommerce","description":"Ecommerce chapter of the 2019 Web Almanac covering ecommerce platforms, payloads, images, third-parties, performance, seo, and PWAs.","authors":["samdutton","alankent"],"reviewers":["voltek62"],"translators":[""],"discuss":"1768","published":"2019-11-11T00:00:00.000Z","last_updated":"2020-01-10T00:00:00.000Z"} %} {% set chapter_image_dir = ("/static/images/2019/%s" % get_chapter_image_dir(metadata)) %} {% block description %}{{ metadata.get('description',metadata.get('title') + ' chapter of the ' + year + ' Web Almanac probing into the use of ' + metadata.get('description',metadata.get('title')) + ' on the web.') }}{% endblock %} {% block meta %}
<meta name="description" content="{{ self.description() }}" />
<meta property="og:title" content="{{ self.title() }}" />
<meta property="og:url" content="https://almanac.httparchive.org{{ url_for(request.endpoint, **get_view_args(lang=language.lang_code, year=year)) }}" />
Expand Down Expand Up @@ -592,7 +592,7 @@ <h2 id="popular-image-formats">Popular image formats</h2>
<div id="fig15-description" class="visually-hidden">Bar chart showing the popularity of various image formats. JPEG is the most popular format at 54% of images on desktop ecommerce pages. Next are PNG at 27%, GIF at 14%, SVG at 2%, and WebP and ICO at 1% each.</div>
<figcaption id="fig15-caption">Figure 15. Popular image formats.</figcaption>
</figure>
<aside class="note">Note that some image services or CDNs will automatically deliver WebP (rather than JPEG or PNG) to platforms that support WebP, even for a URL with a `.jpg` or `.png` suffix. For example, [IMG_20190113_113201.jpg](https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg) returns a WebP image in Chrome. However, the way HTTP Archive [detects image formats](https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994) is to check for keywords in the MIME type first, then fall back to the file extension. This means that the format for images with URLs such as the above will be given as WebP, since WebP is supported by HTTP Archive as a user agent.</aside>
<aside class="note">Note that some image services or CDNs will automatically deliver WebP (rather than JPEG or PNG) to platforms that support WebP, even for a URL with a `.jpg` or `.png` suffix. For example, <a href="https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg">IMG_20190113_113201.jpg</a> returns a WebP image in Chrome. However, the way HTTP Archive <a href="https://github.com/HTTPArchive/legacy.httparchive.org/blob/31a25b9064a365d746d4811a1d6dda516c0e4985/bulktest/batch_lib.inc#L994">detects image formats</a> is to check for keywords in the MIME type first, then fall back to the file extension. This means that the format for images with URLs such as the above will be given as WebP, since WebP is supported by HTTP Archive as a user agent.</aside>
<h3 id="png">PNG</h3>
<p>One in four images on ecommerce pages are PNG. The high number of PNG requests from pages on ecommerce platforms is probably for product images. Many commerce sites use PNG with photographic images to enable transparency.</p>
<p>Using WebP with a PNG fallback can be a far more efficient alternative, either via a <a href="http://simpl.info/picturetype">picture element</a> or by using user agent capability detection via an image service such as <a href="https://res.cloudinary.com/webdotdev/f_auto/w_500/IMG_20190113_113201.jpg">Cloudinary</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<url>
<loc>https://almanac.httparchive.org/en/2019/ecommerce</loc>
<lastmod>2019-11-23</lastmod>
<lastmod>2020-01-10</lastmod>
</url>

<url>
Expand Down

0 comments on commit eaa36b6

Please sign in to comment.