Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 9010287

Browse files
committed
Prepend event name and year as needed to titles
1 parent b2d4dfa commit 9010287

1 file changed

Lines changed: 39 additions & 6 deletions

File tree

layouts/partials/head.html

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,49 @@
22
{{- partial "head/seo.html" . -}}
33

44
<title>
5-
{{- $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}}
6-
{{- if eq $url "/" -}}
7-
{{ .Site.Title }}
5+
{{- if .IsHome -}}
6+
{{ $.Scratch.Set "title" "devopsdays" }}
87
{{- else -}}
9-
{{- if .Params.Heading -}}
10-
{{ .Params.Heading }}
8+
{{- if .IsPage -}}
9+
{{- if or (eq .Type "welcome") (eq .Type "event") (eq .Type "speakers") (eq .Type "talk") (eq .Type "speaker") -}}
10+
{{- $e := (index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2)) -}}
11+
{{- if eq (lower .Title) "welcome" -}}
12+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s" $e.city (chomp $e.year)) -}}
13+
{{- else if eq (lower .Title) "conduct" -}}
14+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - code of conduct" $e.city (chomp $e.year)) -}}
15+
{{- else if eq (lower .Title) "contact" -}}
16+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - contact information" $e.city (chomp $e.year)) -}}
17+
{{- else if eq (lower .Title) "location" -}}
18+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - location information" $e.city (chomp $e.year)) -}}
19+
{{- else if eq (lower .Title) "program" -}}
20+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - program" $e.city (chomp $e.year)) -}}
21+
{{- else if eq (lower .Title) "propose" -}}
22+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - propose a talk" $e.city (chomp $e.year)) -}}
23+
{{- else if eq (lower .Title) "registration" -}}
24+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - register" $e.city (chomp $e.year)) -}}
25+
{{- else if eq (lower .Title) "speakers" -}}
26+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - speakers" $e.city (chomp $e.year)) -}}
27+
{{- else if eq (lower .Title) "sponsor" -}}
28+
{{- $.Scratch.Set "title" (printf "devopsdays %s %s - sponsorship information" $e.city (chomp $e.year)) -}}
29+
{{- else if eq .Type "talk" -}}
30+
{{- $.Scratch.Set "title" (printf "%s - devopsdays %s %s" .Title $e.city (chomp $e.year)) -}}
31+
{{- else if eq .Type "speaker" -}}
32+
{{- $.Scratch.Set "title" (printf "%s - devopsdays %s %s" .Title $e.city (chomp $e.year)) -}}
33+
{{- else -}}
34+
{{- $.Scratch.Set "title" .Title -}}
35+
{{- end -}}
36+
{{- if not ($.Scratch.Get "title") -}}
37+
{{- $.Scratch.Set "title" .Title -}}
38+
{{- end -}}
39+
{{- end -}}
40+
{{- if not ($.Scratch.Get "title") -}}
41+
{{- $.Scratch.Set "title" .Title -}}
42+
{{- end -}}
1143
{{- else -}}
12-
{{ .Title }}
44+
{{- $.Scratch.Set "title" .Title -}}
1345
{{- end -}}
1446
{{- end -}}
47+
{{ $.Scratch.Get "title" }}
1548
</title>
1649
<link rel="canonical" href="{{ .Permalink | absURL }}">
1750
{{- partial "head_includes.html" . -}}

0 commit comments

Comments
 (0)