Skip to content

Commit 10cddcd

Browse files
committed
Improve various page metadata
Add more detail to description tags for routes Canonicalize various internal links Fix broken internal links in ragnar app
1 parent 51f2384 commit 10cddcd

File tree

13 files changed

+79
-35
lines changed

13 files changed

+79
-35
lines changed

_includes/schedule_table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
{% endif %}
4646
<td class="{{part-cancelled-class}}">
4747
{% if plan.route_id %}
48-
<a href="{{site.baseurl}}/routes/{{ plan.route_id }}" title="{{ plan.route_id }}">{{route.name}}</a>
48+
<a href="{{site.baseurl}}/routes/{{ plan.route_id }}/" title="{{ plan.route_id }}">{{route.name}}</a>
4949
{% elsif route.map %}
5050
<a target="_blank" href="{{ route.map }}">{{route.name}}</a>
5151
{% else %}

_layouts/base.html

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@
33
<head>
44
<meta charset="UTF-8">
55
{% capture title %}{% if page.title %}{{ page.title | escape }} || {{ site.title | escape}}{% else %}{{ site.title | escape }}{% endif %}{% endcapture %}
6-
{% capture description %}{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}{% endcapture %}
6+
{% capture type %}{% if page.type == "OB" %}out-and-back{% elsif page.type == "Loop" %}loop{% elsif page.type == "P2P" %}point-to-point{% endif %}{% endcapture %}
7+
{% if page.distance_mi %}
8+
{% if page.start_neighborhood == page.end_neighborhood %}
9+
{% if page.start_neighborhood == 'non-Seattle' %}
10+
{% capture description %}{{ page.distance_mi }} mile {{type}} running/walking route with {{page.ascent_m}}m of elevation gain{% endcapture %}
11+
{% elsif page.type == "OB" or page.type == "P2P" %}
12+
{% capture description %}{{ page.distance_mi }} mile {{type}} running/walking route visiting {% for neighborhood in page.neighborhoods limit:3 %}{{neighborhood}}{% unless forloop.last%}, {%endunless%}{%endfor%}.{% endcapture %}
13+
{% else %}
14+
{% capture description %}{{ page.distance_mi }} mile {{type}} running/walking route near {{page.start_neighborhood }}{% endcapture %}
15+
{% endif %}
16+
{% else %}
17+
{% capture description %}{{ page.distance_mi }} mile {{type}} running/walking route from {{page.start_neighborhood}} to {{page.end_neighborhood}} via {% for neighborhood in page.neighborhoods limit:3 %}{{neighborhood}}{% unless forloop.last%}, {%endunless%}{%endfor%}.{% endcapture %}
18+
{% endif %}
19+
{% else %}
20+
{% capture description %}{{ page.excerpt | default: page.description | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}{% endcapture %}
21+
{% endif %}
722
{% capture url %}{{ page.url | absolute_url }}{% endcapture %}
823
<title>{{ title }}</title>
924
<link rel="canonical" href="{{ site.url }}{{ page.url }}" />
@@ -54,43 +69,43 @@
5469
<body>
5570

5671
<header class="container">
57-
<a href="/" class="text-body">
58-
<img src='{{ site.baseurl }}/img/rcc-logo.png' width='150' alt='RCC Logo' class="float-end">
59-
<h1>Race Condition Running</h1>
72+
<a href="/" class="text-body d-flex flex-wrap align-content-end justify-content-between">
73+
<h2 class="align-self-center">Race Condition Running</h2>
74+
<img src='{{ site.baseurl }}/img/rcc-logo.png' width='150' alt='RCC Logo'>
6075
</a>
6176
</header>
6277

6378
<nav class="navbar navbar-expand-sm mb-4 container" role="navigation">
6479
<div class="container">
6580
<ul class="navbar-nav justify-content-between">
66-
<li class="nav-item"><a href="{{ site.baseurl }}/"{% if page.url == "/" %} class="active"{% endif %}>Schedule</a></li>
67-
<li class="nav-item"><a href="{{ site.baseurl }}/routes/"{% if page.url == "/routes/" %} class="active"{% endif %}>Routes</a></li>
68-
<li class="nav-item"><a href="{{ site.baseurl }}/brunch-reviews/"{% if page.url == "/brunch-reviews/" %} class="active"{% endif %}>Brunch Reviews</a></li>
81+
<li class="nav-item"><a href="{% link index.html %}"{% if page.url == "/" %} class="active"{% endif %}>Schedule</a></li>
82+
<li class="nav-item"><a href="{% link pages/routes.html %}"{% if page.url == "/routes/" %} class="active"{% endif %}>Routes</a></li>
83+
<li class="nav-item"><a href="{% link pages/brunch-reviews.html %}"{% if page.url == "/brunch-reviews/" %} class="active"{% endif %}>Brunch Reviews</a></li>
6984
<li class="nav-item dropdown">
70-
<a href="{{ site.baseurl }}/events" id="eventsDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Events</a>
85+
<a href="{% link pages/events.html %}" id="eventsDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Events</a>
7186
<ul class="dropdown-menu" aria-labelledby="eventsDropdown">
7287
<li>
73-
<a class="dropdown-item text-start" href="{{ site.baseurl }}/light-rail-relay-24/">Light Rail Relay '24</a>
88+
<a class="dropdown-item text-start" href="{% link pages/light-rail-relay-24.html %}">Light Rail Relay '24</a>
7489
<ul class="list-inline d-flex gap-2 dropdown-item">
75-
<li><a class="link-secondary" href="{{ site.baseurl }}/light-rail-relay-23/">23</a></li>
76-
<li><a class="link-secondary" href="{{ site.baseurl }}/light-rail-relay-22/">22</a></li>
77-
<li><a class="link-secondary" href="{{ site.baseurl }}/light-rail-relay-21/">21</a></li>
90+
<li><a class="link-secondary" href="{% link pages/light-rail-relay-23.html %}">23</a></li>
91+
<li><a class="link-secondary" href="{% link pages/light-rail-relay-22.html %}">22</a></li>
92+
<li><a class="link-secondary" href="{% link pages/light-rail-relay-21.html %}">21</a></li>
7893
</ul>
7994
</li>
8095

8196
<li>
82-
<a class="dropdown-item text-start" href="{{ site.baseurl }}/drumheller-marathon-25/">Drumheller Marathon '25</a>
97+
<a class="dropdown-item text-start" href="{% link pages/drumheller-marathon-25.html %}">Drumheller Marathon '25</a>
8398
<ul class="list-inline d-flex gap-2 dropdown-item">
84-
<li><a class="link-secondary" href="{{ site.baseurl }}/drumheller-marathon-24/">24</a></li>
85-
<li><a class="link-secondary" href="{{ site.baseurl }}/drumheller-half-23/">23</a></li>
86-
<li><a class="link-secondary" href="{{ site.baseurl }}/drumheller-half-22/">22</a></li>
99+
<li><a class="link-secondary" href="{% link pages/drumheller-marathon-24.html %}">24</a></li>
100+
<li><a class="link-secondary" href="{% link pages/drumheller-half-23.html %}">23</a></li>
101+
<li><a class="link-secondary" href="{% link pages/drumheller-half-22.html %}">22</a></li>
87102
</ul>
88103
</li>
89104

90105
<li><a class="dropdown-item text-start {% if page.url == "{{ site.baseurl }}/quarantine-relay/" %} active{% endif %}" href="{{ site.baseurl }}/quarantine-relay/">Quarantine Relay</a></li>
91106
</ul>
92107
</li>
93-
<li class="nav-item"><a href="{{ site.baseurl }}/lore/"{% if page.url == "/lore/" %} class="active"{% endif %}>Lore</a></li>
108+
<li class="nav-item"><a href="{% link pages/lore.html %}"{% if page.url == "/lore/" %} class="active"{% endif %}>Lore</a></li>
94109
</ul>
95110
</div>
96111
</nav>

_layouts/brunch-review.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
{% include brunch_review_card.html reviews=sorted_brunch_reviews %}
77

88
<article class="brunch-review" itemscope itemtype="https://schema.org/BlogPosting">
9-
<h2 itemprop="headline" class="mb-0">{{ page.restaurant }}</h2>
10-
<h5 class="text-secondary"> <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date_to_long_string }}</time>
11-
</h5>
9+
<h1 itemprop="headline" class="mb-0 h2">{{ page.restaurant }}</h1>
10+
<h2 class="text-secondary h5"> <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date_to_long_string }}</time>
11+
</h2>
1212
{% if page.author %}
13-
<h6 class="text-secondary">By <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span></h6>
13+
<h3 class="text-secondary h6">By <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span></h3>
1414
{% endif %}
1515

1616
<div class="post-content" itemprop="articleBody">

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
layout: base
33
---
44
<div class="container">
5+
{% if page.add_h1 %}<h1 class="visually-hidden">{{ page.title }}</h1>{% endif %}
56
{{ content }}
67
</div>

_layouts/route.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
55

66
<div class="route">
7-
<h3 title="{{ page.id }}" class="mb-0">{{ page.title }}</h3>
7+
<h1 title="{{ page.id }}" class="mb-0 h2">{{ page.title }}</h1>
88
{% assign ascent_ft = page.ascent_m | times: 3.28084 %}
99
{% assign descent_ft = page.descent_m | times: 3.28084 %}
10-
<h5><span title="{{ page.distance_mi | times: 1.609 | round: 1}}km">{{ page.distance_mi | round: 1}}</span>mi ↑<span title="{{ page.ascent_m}}m">{{ascent_ft | round}}ft</span><span title="{{ page.descent_m}}m">{{ascent_ft | round}}ft</span> {% if page.deprecated %} <span class="text-warning mx-2" title="We no longer schedule this route">Deprecated</span>{% endif%}</h5>
10+
<h2 class="h5"><span title="{{ page.distance_mi | times: 1.609 | round: 1}}km">{{ page.distance_mi | round: 1}}</span>mi ↑<span title="{{ page.ascent_m}}m">{{ascent_ft | round}}ft</span><span title="{{ page.descent_m}}m">{{ascent_ft | round}}ft</span> {% if page.deprecated %} <span class="text-warning mx-2" title="We no longer schedule this route">Deprecated</span>{% endif%}</h2>
1111
<div class="mb-4">
1212
<a class="btn btn-sm btn-outline-primary" href="{{ page.gpx | relative_url }}" data-goatcounter-click="download-{{ page.id }}">Download GPX</a> {% if page.map %}<a class="btn btn-sm btn-outline-primary" href="{{page.map}}" data-goatcounter-click="ext-map-{{ page.id }}">OnTheGoMap</a>{% endif %}
1313
</div>
@@ -38,7 +38,8 @@ <h5><span title="{{ page.distance_mi | times: 1.609 | round: 1}}km">{{ page.dist
3838
Never
3939
{% endif %}
4040
{% for date_run in page.dates_run reversed %}
41-
<a href="{{ site.baseurl }}/lore#{{ date_run }}">{{ date_run }}</a>{% if forloop.last == false %}, {% endif %}
41+
{% comment %}Gross hash after slash due to how our permalinks and redirects are set up {% endcomment %}
42+
<a href="{{ site.baseurl }}/lore/#{{ date_run }}">{{ date_run }}</a>{% if forloop.last == false %}, {% endif %}
4243
{% endfor %}
4344
</div>
4445
{% if page.notes %}

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
layout: default
3+
title: Schedule
4+
add_h1: true
35
---
46

57
<div class="container text-center">

js/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function relayToGPX(trackName, legs, exchanges, options = {}) {
115115
</gpx>`;
116116
}
117117

118-
export function legToGPX(coords, eventName, trackName) {
118+
export function legToGPX(coords, eventName, trackName, year) {
119119
let points = ""
120120
for (let coord of coords) {
121121
points += ` <rtept lat="${coord[1]}" lon="${coord[0]}"/>\n`

pages/brunch-reviews.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
<article class="brunch-review" itemscope itemtype="https://schema.org/BlogPosting">
1313
<h2 itemprop="headline" class="mb-0">{{ latest_review.restaurant }}</h2>
14-
<h5 class="text-secondary"> <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ latest_review.date | date_to_long_string }}</time>
15-
</h5>
14+
<h3 class="text-secondary h5"> <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ latest_review.date | date_to_long_string }}</time>
15+
</h3>
1616
{% if latest_review.author %}
17-
<h6 class="text-secondary">By <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ latest_review.author }}</span></span></h6>
17+
<h3 class="text-secondary h6">By <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ latest_review.author }}</span></span></h3>
1818
{% endif %}
1919

2020
<div class="post-content" itemprop="articleBody">

pages/drumheller-half-23.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@
585585
<header>
586586

587587
<div id="logo">
588+
<h1 class="visually-hidden">Drumheller Half Marathon 2023</h1>
588589
<img id="overlay" src="{{ site.baseurl }}/img/dhm23/dhm23.svg"
589590
alt="Line art of a fountain surrounded by text Drumheller Half Marathon 2023"/>
590591
<img id="underlay-cw" class="rotating" src="{{ site.baseurl }}/img/dhm23/rose.webp" alt=""/>

pages/events.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: Events
3+
description: Club-organized special events
34
permalink: events/
45
layout: default
6+
add_h1: true
57
---
68

79
<div class="container">

0 commit comments

Comments
 (0)