Skip to content

Commit 552f929

Browse files
oschwaldclaude
andcommitted
Guard .File.BaseFileName in title for virtual pages
`.File` is nil on virtual pages (e.g., taxonomy listings before they were disabled). Wrap with `with .File` so the title rendering is null-safe even if future virtual pages get enabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d901463 commit 552f929

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

docs/layouts/_default/default.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ or .Title .File.BaseFileName }} | {{ .Site.Title }}{{ end }}</title>
6+
{{- $title := or .Title .File.BaseFileName -}}
7+
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ $title }} | {{ .Site.Title }}{{ end }}</title>
78
<style>
89
:root {
910
--fg: #2d2d2d;

0 commit comments

Comments
 (0)