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

Misc fixes in preparation of adding HTML Linter #997

Merged
merged 5 commits into from
Jul 12, 2020
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ For news and announcements, follow [@HTTPArchive](https://twitter.com/HTTPArchiv

The Web Almanac is licensed under the Apache License 2.0.

![](https://almanac.httparchive.org/static/images/methodology-characters.png)
![Almanac Characters](https://almanac.httparchive.org/static/images/methodology-characters.png)
30 changes: 15 additions & 15 deletions src/content/es/2019/ecommerce.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/content/fr/2019/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ Lighthouse calcule un score pour chaque audit, allant de 0 à 100 %, et ces

<figure>
<a href="/static/images/2019/caching/fig21.png">
<img src="/static/images/2019/caching/fig21.png" alt="Figure 21. Distribution des scores Lighthouse pour l'audit &quot;Définit un long cache TTL&quot; pour les pages web mobiles." aria-labelledby="fig21-caption" aria-describedby="fig21-description" width="600" height="371" data-width="600" data-height="371" data-seamless data-frameborder="0" data-scrolling="no" data-iframe="https://docs.google.com/spreadsheets/d/e/2PACX-1vT3GWCs19Wq0mu0zgIlKRc8zcXgmVEk2xFHuzZACiWVtqOv8FO5gfHwBxa0mhU6O9TBY8ODdN4Zjd_O/pubchart?oid=827424070&amp;format=interactive">
<img src="/static/images/2019/caching/fig21.png" alt="Figure 21. Distribution des scores Lighthouse pour l'audit «Définit un long cache TTL» pour les pages web mobiles." aria-labelledby="fig21-caption" aria-describedby="fig21-description" width="600" height="371" data-width="600" data-height="371" data-seamless data-frameborder="0" data-scrolling="no" data-iframe="https://docs.google.com/spreadsheets/d/e/2PACX-1vT3GWCs19Wq0mu0zgIlKRc8zcXgmVEk2xFHuzZACiWVtqOv8FO5gfHwBxa0mhU6O9TBY8ODdN4Zjd_O/pubchart?oid=827424070&amp;format=interactive">
</a>
<div id="fig21-description" class="visually-hidden">Un diagramme à barres superposées&nbsp;: 38,2&nbsp;% des sites web obtiennent un score de < 10&nbsp;%, 29,0&nbsp;% des sites web obtiennent un score entre 10 et 39&nbsp;%, 18,7&nbsp;% des sites web obtiennent un score de 40 à 79&nbsp;%, 10,7&nbsp;% des sites web obtiennent un score de 80 à 99&nbsp;%, et 3,4&nbsp;% des sites web obtiennent un score de 100&nbsp;%.</div>
<figcaption id="fig21-caption">Figure 21. Distribution des scores Lighthouse pour l'audit "Définit un long cache TTL" pour les pages web mobiles.</figcaption>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/base/2019/accessibility_statement.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ <h1 class="title title-lg">Accessibility Statement</h1>
{% block scripts %}
{{ super() }}
{{ self.index_menu_script() }}
<script src='/static/js/chapter.js?v=20200527181403' defer></script>
<script src="/static/js/chapter.js?v=20200527181403" defer></script>
{% endblock %}
22 changes: 14 additions & 8 deletions src/templates/base/2019/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
</button>
<ul class="menu">
{{ self.non_chapter_nav_links() }}
<li>
<li>
{{ year_switcher('mobile') }}
</li>
Expand Down Expand Up @@ -326,11 +325,15 @@
<label for="language-switcher-{{switcher_name}}" class="visually-hidden">{{ self.language_switcher() }}</label>
<select id="language-switcher-{{switcher_name}}">
{% for l in supported_languages | sort(attribute='_local_name') %}
<option
{% if l == language %}selected="selected"{% endif %}
lang="{{ l.lang_code }}" value="{{ url_for(request.endpoint, **get_view_args(lang=l.lang_code)) }}" >
{% if l == language %}
<option selected="selected" lang="{{ l.lang_code }}" value="{{ url_for(request.endpoint, **get_view_args(lang=l.lang_code)) }}">
{{ l }}
</option>
{% else %}
<option lang="{{ l.lang_code }}" value="{{ url_for(request.endpoint, **get_view_args(lang=l.lang_code)) }}">
{{ l }}
</option>
{% endif %}
{% endfor %}
<option disabled="disabled" aria-hidden="true">
────
Expand All @@ -351,11 +354,15 @@
<label for="year-switcher-{{switcher_name}}" class="visually-hidden">{{ self.year_switcher() }}</label>
<select id="year-switcher-{{switcher_name}}">
{% for y in supported_years | sort %}
<option
{% if y == year %}selected="selected"{% endif %}
value="{{ url_for(request.endpoint, **get_view_args(lang=lang,year=y)) }}">
{% if y == year %}
<option selected="selected" value="{{ url_for(request.endpoint, **get_view_args(lang=lang,year=y)) }}">
{{ y }}
</option>
{% else %}
<option value="{{ url_for(request.endpoint, **get_view_args(lang=lang,year=y)) }}">
{{ y }}
</option>
{% endif %}
{% endfor %}
{# If the current page doesn't support a year, then show a home link for that year #}
{% if supported_years|length < all_supported_years|length %}
Expand All @@ -376,7 +383,6 @@
{% endmacro %}
{% endif %}


{% block index_menu_script %}
<script nonce="{{ csp_nonce() }}">

Expand Down
32 changes: 16 additions & 16 deletions src/templates/base/2019/base_chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
{% for author in metadata.get('authors') %}{% if loop.length > 1 and loop.index == 1 %}[{% endif -%}
{% set authordata = config.contributors[author] if author in config.contributors else None -%}
{% if authordata -%}
{
"@type": "Person",
{
"@type": "Person",
"sameas": [
"https://almanac.httparchive.org{{ url_for('contributors', year=year, lang=lang, _anchor=author) }}"
{% if authordata.twitter %},"https://twitter.com/{{ authordata.twitter }}"{% endif %}
{% if authordata.github %},"https://github.com/{{ authordata.github }}"{% endif %}
],
"name": "{{ authordata.name if authordata.name else author }}"
"name": "{{ authordata.name if authordata.name else author }}"
}{% if loop.index < loop.length %},{% endif %}
{%- endif %}{% if loop.index > 1 and loop.index == loop.length %}]{% endif -%}
{% endfor %}
Expand All @@ -37,24 +37,24 @@
<script nonce="{{ csp_nonce() }}">

document.addEventListener("keyup", function onPress(event) {
if (event.key === 'p' || event.key === 'P' || event.key === ',' || event.key === '<' || event.key === 'ArrowLeft') {
var previous = document.getElementById('previous-chapter');
if (previous) {
previous.click();
}
}
if (event.key === 'n' || event.key === 'N' || event.key === '.' || event.key === '>' || event.key === 'ArrowRight') {
var next = document.getElementById('next-chapter');
if (next) {
next.click();
}
}
if (event.key === 'p' || event.key === 'P' || event.key === ',' || event.key === '<' || event.key === 'ArrowLeft') {
var previous = document.getElementById('previous-chapter');
if (previous) {
previous.click();
}
}
if (event.key === 'n' || event.key === 'N' || event.key === '.' || event.key === '>' || event.key === 'ArrowRight') {
var next = document.getElementById('next-chapter');
if (next) {
next.click();
}
}
});

window.discussion_url="https://discuss.httparchive.org/t/{{ metadata.get('discuss') }}.json";
</script>

<script src='/static/js/chapter.js?v=20200527181403' defer></script>
<script src="/static/js/chapter.js?v=20200527181403" defer></script>

{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/templates/base/2019/contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,5 +423,5 @@ <h1 class="title title-lg">

</script>
<!-- add chapter.js to handle print mode and avoid duplicating code -->
<script src='/static/js/chapter.js?v=20200527181403' defer></script>
<script src="/static/js/chapter.js?v=20200527181403" defer></script>
{% endblock %}
2 changes: 1 addition & 1 deletion src/templates/base/2019/methodology.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ <h1 class="title title-lg">{{ self.methodology_title() }}</h1>
{% block scripts %}
{{ super() }}
{{ self.index_menu_script() }}
<script src='/static/js/chapter.js?v=20200527181403' defer></script>
<script src="/static/js/chapter.js?v=20200527181403" defer></script>
{% endblock %}
Loading