Skip to content

Commit 91a3c4f

Browse files
Turn headings into links (#1044)
* turn headings into anchor links * remove anchor emoji to make design consistent with rest of the report + add anchor links to all headings * remove commented code --------- Co-authored-by: Barry Pollard <barrypollard@google.com>
1 parent adcbdcd commit 91a3c4f

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

static/css/techreport/techreport.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ nav {
224224
display: none;
225225
}
226226

227+
/* Heading links */
228+
.anchor {
229+
color: inherit;
230+
}
231+
227232
/* Filter info */
228233
.meta {
229234
font-size: 0.75rem;

templates/techreport/category.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ <h1>
8888
data-type="section"
8989
data-api="category"
9090
>
91-
<h2 class="summary-heading">Summary</h2>
91+
<h2 class="summary-heading"><a href="#cateogry-summary" class="anchor">Summary</a></h2>
9292
<div class="summary-grid">
9393
{% for summary in tech_report_page.config.summary %}
9494
{% include "techreport/components/summary_card.html" %}
@@ -102,7 +102,7 @@ <h2 class="summary-heading">Summary</h2>
102102
data-type="section"
103103
data-api="cwv,lighthouse,page-weight"
104104
>
105-
<h2>Technologies</h2>
105+
<h2><a href="#comparison-summary" class="anchor">Technologies</a></h2>
106106
<div class="table-descr">
107107
<p>
108108
Overview of the latest Core Web Vitals of all technologies within this category, sorted by number of origins.

templates/techreport/comparison.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1>
2929
data-type="section"
3030
data-api="cwv,lighthouse,page-weight"
3131
>
32-
<h2>Summary</h2>
32+
<h2><a href="#comparison-summary" class="anchor">Summary</a></h2>
3333
<p>Showing the latest data for <strong>{{ technologies | length }} technologies</strong>.</p>
3434
{% set component = tech_report_page.config.tech_comparison_summary %}
3535
{% set id = component.id %}
@@ -48,7 +48,7 @@ <h2>Summary</h2>
4848
data-type="section"
4949
data-api="cwv"
5050
>
51-
<h2>Core Web Vitals</h2>
51+
<h2><a href="#comparison-good-cwvs" class="anchor">Core Web Vitals</a></h2>
5252
<p>{{ tech_report_labels.metrics.vitals.general.description }}</p>
5353

5454
<!-- Timeseries -->
@@ -68,7 +68,7 @@ <h2>Core Web Vitals</h2>
6868
data-type="section"
6969
data-api="lighthouse"
7070
>
71-
<h2>Lighthouse</h2>
71+
<h2><a href="#comparison-lighthouse" class="anchor">Lighthouse</a></h2>
7272
<p>{{ tech_report_labels.metrics.lighthouse.general.description }}</p>
7373

7474
<!-- Timeseries -->
@@ -88,7 +88,7 @@ <h2>Lighthouse</h2>
8888
data-type="section"
8989
data-api="page-weight"
9090
>
91-
<h2>Page weight</h2>
91+
<h2><a href="#comparison-page-weight" class="anchor">Page weight</a></h2>
9292
<p>{{ tech_report_labels.metrics.pageWeight.general.description }}</p>
9393

9494
<!-- Timeseries -->
@@ -108,7 +108,7 @@ <h2>Page weight</h2>
108108
data-type="section"
109109
data-api="adopiton"
110110
>
111-
<h2>Adoption</h2>
111+
<h2><a href="#comparison-adoption" class="anchor">Adoption</a></h2>
112112
<p>{{ tech_report_labels.metrics.adoption.general.description }}</p>
113113

114114
<!-- Timeseries -->

templates/techreport/components/timeseries.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% set category = selected_subcategory or subcategory.default %}
22
{% set endpoint = timeseries.endpoint %}
33

4-
<div data-id="{{ timeseries.id }}" data-component="timeseries" data-endpoint="{{timeseries.endpoint}}" data-category="{{category}}" data-metric="{{timeseries.metric}}" data-summary="{{timeseries.viz.metric_summary}}" data-client="{{ request.args.get('client', '') or 'mobile' }}">
4+
<div id="section-{{ timeseries.id }}" data-id="{{ timeseries.id }}" data-component="timeseries" data-endpoint="{{timeseries.endpoint}}" data-category="{{category}}" data-metric="{{timeseries.metric}}" data-summary="{{timeseries.viz.metric_summary}}" data-client="{{ request.args.get('client', '') or 'mobile' }}">
55
<div class="component-heading-wrapper">
66
<div class="component-heading">
77
{% set title = timeseries.title %}
@@ -11,7 +11,7 @@
1111
{% set descr = tech_report_labels.metrics[endpoint][selected_subcategory].description %}
1212
{% endif %}
1313

14-
<h3>{{ title }}</h3>
14+
<h3><a href="#section-{{ timeseries.id }}" class="anchor">{{ title }}</a></h3>
1515
<p class="descr">{{ descr }}</p>
1616
</div>
1717

templates/techreport/drilldown.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h2 class="summary-heading">Summary</h2>
4949
data-type="section"
5050
data-api="cwv"
5151
>
52-
<h2>Core Web Vitals</h2>
52+
<h2><a class="anchor" href="#good-cwvs">Core Web Vitals</a></h2>
5353
<p>{{ tech_report_labels.metrics.vitals.general.description }}</p>
5454

5555
{% if tech_report_page.config.good_cwv_summary %}
@@ -76,7 +76,7 @@ <h3>{{ tech_report_page.config.good_cwv_summary.title }}</h3>
7676
data-type="section"
7777
data-api="lighthouse"
7878
>
79-
<h2>Lighthouse</h2>
79+
<h2><a class="anchor" href="#lighthouse">Lighthouse</a></h2>
8080
<p>{{ tech_report_labels.metrics.lighthouse.general.description }}</p>
8181

8282
{% if tech_report_page.config.lighthouse_summary %}
@@ -103,7 +103,7 @@ <h3>{{ tech_report_page.config.lighthouse_summary.title }}</h3>
103103
data-type="section"
104104
data-api="page-weight"
105105
>
106-
<h2>Page weight</h2>
106+
<h2><a class="anchor" href="#page-weight">Page weight</a></h2>
107107
<p>{{ tech_report_labels.metrics.pageWeight.general.description }}</p>
108108

109109
{% if tech_report_page.config.weight_summary %}
@@ -130,7 +130,7 @@ <h3>{{ tech_report_page.config.weight_summary.title }}</h3>
130130
data-type="section"
131131
data-api="adoption"
132132
>
133-
<h2>Adoption</h2>
133+
<h2><a class="anchor" href="#adoption">Adoption</a></h2>
134134
<p>{{ tech_report_labels.metrics.adoption.general.description }}</p>
135135

136136
<div class="card">

templates/techreport/techreport.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@
7373

7474
{% block report_content %}{% endblock %}
7575

76-
<div class="feedback">
76+
<div class="feedback" id="section-feedback">
7777
<div class="block-m">
78-
<h2>Feedback?</h2>
78+
<h2><a href="#section-feedback" class="anchor">Feedback?</a></h2>
7979
<p>
8080
We are still working on this dashboard. The design and functionality can still change, and we're working on accessibility improvements and bugfixes.
8181
What you're seeing here is a snapshot of our latest GitHub commit, and are <a href="https://github.com/HTTPArchive/httparchive.org/issues/new?template=tech-report.md">open for feedback</a>.
8282
</p>
8383
</div>
8484
</div>
8585

86-
<div class="accessibility-options">
86+
<div class="accessibility-options" id="section-accessibility-options">
8787
<div class="wrapper block-m">
88-
<h2>Accessibility</h2>
88+
<h2><a href="#section-accessibility-options" class="anchor">Accessibility</a></h2>
8989
<p>Change settings related to accessibility here</p>
9090

9191
<div class="setting">

0 commit comments

Comments
 (0)