Skip to content

Commit 129ec42

Browse files
this is a fix for the page metadata being used as display information… (#1036)
* this is a fix for the page metadata being used as display information in the guides, which prevented us from having an SEO-friendly title that was different from the display title. I would not claim that this solve is particularly elegant, but it does work, and didn't require me to alter any guides not needing SEO updates * dynamic page title length * final revisions to /learn pages for SEO
1 parent f65000a commit 129ec42

File tree

10 files changed

+68
-17
lines changed

10 files changed

+68
-17
lines changed

site/content/guides/monitoring-as-code-cli.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
2-
title: Monitoring as code with the Checkly CLI
3-
description: >-
2+
title: What is End to End Monitoring? Overview with Examples
3+
displayTitle: Monitoring as code with the Checkly CLI
4+
metatags:
5+
title: What is End to End Monitoring? Overview with Examples
6+
description: Discover how Monitoring as Code transforms cloud infrastructure management with a hands-on Checkly case study. Start optimizing your workflow today!
7+
displayDescription: >-
48
The as code movement has been picking up steam over the last few years, offering a way for DevOps teams to transparently manage and scale cloud infrastructure, security and other ressources. Why should the way we manage monitoring be any different? In this article, we address this point and illustrate it with a practical example of monitoring as code (MaC) via our Checkly CLI.
59
author: Hannes Lenke
610
avatar: 'images/avatars/hannes-lenke.png'

site/content/learn/headless/_index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
2-
Title: Learn Playwright & Puppeteer
3-
description:
2+
title: Learn Playwright & Puppeteer Browser Automation Frameworks
3+
displayTitle: Learn Playwright & Puppeteer
4+
description: Learn more about Playwright & Puppeteer with Checkly. Explore how to automate your web with a reliable, programmable monitoring workflow.
5+
displayDescription:
46
Learn more about Playwright & Puppeteer with Checkly. Explore how to automate your web with a reliable, programmable monitoring workflow.
57
metatags:
68
title: Learn Playwright & Puppeteer - Browser Automation Frameworks

site/content/learn/headless/basics-navigation.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Navigation & waiting
2+
title: Navigation & Waiting Strategies in Puppeteer & Playwright
3+
displayTitle: Navigation & waiting
34
metatags:
45
title: Navigation & Waiting Strategies in Puppeteer & Playwright
56
subTitle: How to ensure elements are ready for interaction

site/content/learn/headless/basics-selectors.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
title: Working with selectors
3-
metatags:
4-
title: UI Selectors - A Guide for Puppeteer & Playwright | Checkly
2+
title: UI Selectors - A Guide for Puppeteer & Playwright | Checkly
3+
displayTitle: Working with selectors
54
description:
65
Learn to write solid scripts using Puppeteer, Playwright, and other UI selectors. Discover how to choose stable selectors and start enhancing your skills today.
76
subTitle: Techniques and pointers

site/layouts/guides/list.html

+14-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ <h1 class="display-3">{{ .Title }}</h1>
88
<div class="guide-card">
99
<div>
1010
<div class="guide-info">
11-
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
12-
<p>{{ .Params.description }}</p>
11+
<h2><a href="{{ .RelPermalink }}">
12+
{{ if .Params.displayTitle}}
13+
{{.Params.displayTitle}}
14+
{{else}}
15+
{{.Title}}
16+
{{end}}
17+
</a></h2>
18+
<p>
19+
{{ if .Params.displayDescription}}
20+
{{.Params.displayDescription}}
21+
{{else}}
22+
{{.Description}}
23+
{{end}}
24+
</p>
1325
</div>
1426
<div class="write-info">
1527
<img src="{{ .Params.avatar | relURL }}" alt="{{ .Params.author }}" width="24" height="24" />

site/layouts/guides/single.html

+15-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@
55
<div class="guides__label">
66
Checkly Guides
77
</div>
8-
<h1 class="guides__title">{{.Title}}</h1>
8+
<h1 class="guides__title">
9+
{{ if .Params.displayTitle}}
10+
{{.Params.displayTitle}}
11+
{{else}}
12+
{{.Title}}
13+
{{end}}
14+
</h1>
915
<div class="guides-toc-mobile mb-5 pt-3">
1016
<div class="guides-toc-header mb-3 pt-3">On this page</div>
1117
{{ .Page.TableOfContents }}
1218
</div>
13-
{{ if .Description }}
14-
<p class="guides__description">{{.Description}}</p>
19+
{{ if or (.Description) (.Params.displayDescription) }}
20+
<p class="guides__description">
21+
{{ if .Params.displayDescription}}
22+
{{.Params.displayDescription}}
23+
{{else}}
24+
{{.Description}}
25+
{{end}}
26+
</p>
1527
{{ end }}
1628
<span class="markdown">{{.Content}}</span>
1729
</div>

site/layouts/learn/list.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
<img src="/images/icons/toc-icon.svg" alt="table of contents" width="14" height="12" /> Table of contents
99
</div>
1010
</div>
11-
<h1>{{ .Title }}</h1>
11+
<h1>
12+
{{ if .Params.displayTitle}}
13+
{{.Params.displayTitle}}
14+
{{else}}
15+
{{.Title}}
16+
{{end}}
17+
</h1>
1218
<div class="learn-toc-mobile mb-5 pt-3">
1319
<div class="learn-toc-header mb-3 pt-3">On this page</div>
1420
{{ .Page.TableOfContents }}

site/layouts/learn/single.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
{{ end }}
2727
{{ end }}
2828
</div>
29-
<h1>{{ .Title }}</h1>
29+
<h1>
30+
{{ if .Params.displayTitle}}
31+
{{.Params.displayTitle}}
32+
{{else}}
33+
{{.Title}}
34+
{{end}}</h1>
3035
<div class="learn-toc-mobile mb-5 pt-3">
3136
<div class="learn-toc-header mb-3 pt-3">On this page</div>
3237
{{ .Page.TableOfContents }}

site/layouts/partials/docs-title.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{{ $title := "" }}
22

3-
{{ if .Title }}
3+
{{ if .Page.Params.displayTitle}}
4+
{{ $title = .Page.Params.displayTitle}}
5+
{{ else if .Title }}
46
{{ $title = .Title }}
57
{{ else if and .IsSection .File }}
68
{{ $sections := split (trim .File.Dir "/") "/" }}

site/layouts/partials/head.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<head>
2-
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.head.title }}{{ .Params.head.title }}{{ else }}{{ .Title }} | Checkly {{ end }}</title>
2+
<title>
3+
{{$title := "Checkly Documentation"}}
4+
{{ if .IsHome }}{{ $title = .Site.Title }}{{ else if .Params.head.title }}{{ $title =.Params.head.title }}{{ else }}{{ $title = .Title }}{{ end }}
5+
{{$titleLength := $title | len}}
6+
{{if lt $titleLength 50}}
7+
{{$title}} | Checkly
8+
{{else}}
9+
{{$title}}
10+
{{end}}</title>
311
<meta charset="utf-8" />
412
<meta name="description" content="{{ with .Description }}{{ . | markdownify }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . | markdownify}}{{ end }}{{ end }}{{ end }}" />
513
<meta name="viewport" content="width=device-width" initial-scale="1" maximum-scale="1" />

0 commit comments

Comments
 (0)