Skip to content

Commit 6c0ffec

Browse files
dynamic page title length
1 parent 027dd8c commit 6c0ffec

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

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/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/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)