Unify HTML and RSS titles

master
Will Faught 3 years ago
parent 10382fed51
commit 602a71e593

@ -60,7 +60,8 @@ The HTML keywords is a union of the page keywords, tags, and categories.
The HTML title is the page title, followed by a middle dot, followed by The HTML title is the page title, followed by a middle dot, followed by
the site title. If one is missing, the other is used without the middle the site title. If one is missing, the other is used without the middle
dot. If both are the same, only one is used without the middle dot. dot. If both are the same for the home page, the title is the page
title.
The HTML body can have a header, a body, and a footer. The header has The HTML body can have a header, a body, and a footer. The header has
the section menus, if any; the page title, if any; the page description, the section menus, if any; the page title, if any; the page description,

@ -3,7 +3,6 @@ blurb: There's a new daddy in town. A discipline daddy. If I make this comeback,
description: Go ahead, touch the Cornballer description: Go ahead, touch the Cornballer
greeting: You know [best](https://www.youtube.com/watch?v=1WDW8XKEGgU) greeting: You know [best](https://www.youtube.com/watch?v=1WDW8XKEGgU)
stretch: stretch.jpg stretch: stretch.jpg
title: No Borders, No Limits
--- ---
<p class="lead text-center"> <p class="lead text-center">

@ -1,10 +1,14 @@
{{ define "main" }} {{ define "main" }}
{{ if .Title }} {{ $title := .Title }}
{{ if not $title }}
{{ $title = .Site.Title }}
{{ end }}
{{ if $title }}
<h1 class="display-1 fw-bold text-center"> <h1 class="display-1 fw-bold text-center">
{{ if .Params.link }} {{ if .Params.link }}
<a href="{{ .Params.link }}">{{ .Title | markdownify }}</a> <a href="{{ .Params.link }}">{{ $title | markdownify }}</a>
{{ else }} {{ else }}
{{ .Title | markdownify }} {{ $title | markdownify }}
{{ end }} {{ end }}
</h1> </h1>
{{ end }} {{ end }}

@ -1,6 +1,6 @@
<head> <head>
{{ partial "paige_meta.html" . }} {{ partial "paige_meta.html" . }}
{{ partial "paige_title.html" . }} <title>{{ partial "paige_title.html" . }}</title>
{{ partial "paige_link.html" . }} {{ partial "paige_link.html" . }}
{{ partial "paige_style.html" . }} {{ partial "paige_style.html" . }}
{{ if templates.Exists "partials/paige_head_last.html" }} {{ if templates.Exists "partials/paige_head_last.html" }}

@ -3,6 +3,9 @@
{{ if or .Site.Params.math .Params.math }} {{ if or .Site.Params.math .Params.math }}
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css" integrity="sha384-Juol1FqnotbkyZUT5Z7gUPjQ9gzlwCENvUZTpQBAPxtusdwFLRy382PSDx5UUJ4/" rel="stylesheet"> <link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css" integrity="sha384-Juol1FqnotbkyZUT5Z7gUPjQ9gzlwCENvUZTpQBAPxtusdwFLRy382PSDx5UUJ4/" rel="stylesheet">
{{ end }} {{ end }}
{{ if .AlternativeOutputFormats }}
{{ $title := partial "paige_title.html" . }}
{{ range .AlternativeOutputFormats }} {{ range .AlternativeOutputFormats }}
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $.Site.Title }}" type="{{ .MediaType.Type }}"> <link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $title }}" type="{{ .MediaType.Type }}">
{{ end }}
{{ end }} {{ end }}

@ -1,7 +1,15 @@
{{ if and (and .Title .Site.Title) (or (not (eq .Title .Site.Title)) (not .IsHome)) }} {{ $title := "" }}
<title>{{ .Title | markdownify | plainify | htmlUnescape }} &middot; {{ .Site.Title | markdownify | plainify | htmlUnescape }}</title> {{ $pageTitle := .Title | markdownify | plainify | htmlUnescape }}
{{ $siteTitle := .Site.Title | markdownify | plainify | htmlUnescape }}
{{ if and .Title .Site.Title }}
{{ if .IsHome }}
{{ $title = $pageTitle }}
{{ else }}
{{ $title = printf "%s · %s" $pageTitle $siteTitle }}
{{ end }}
{{ else if .Title }} {{ else if .Title }}
<title>{{ .Title | markdownify | plainify | htmlUnescape }}</title> {{ $title = $pageTitle }}
{{ else if .Site.Title }} {{ else if .Site.Title }}
<title>{{ .Site.Title | markdownify | plainify | htmlUnescape }}</title> {{ $title = $siteTitle }}
{{ end }} {{ end }}
{{ return $title }}

Loading…
Cancel
Save