Best solution in terms of complexity

All the title tags on my site take the form: page title - site title.
Except on the home page, where the title tag is: site title - headline.

Everything works fine on my site, but that’s just technical curiosity.

I write in pseudo code.

if isHome solution:

In baseof.html, I have such a title tag:

if isHome
    siteTitle - headline
else
    pageTitle - siteTitle

In this way, the condition is executed on all pages of the site without exception.

block solution:

In baseof.html, I have such a title tag:

define blockTitle
    pageTitle - siteTitle

And in my home.html:

define blockTitle
    siteTitle - headline

Here, the default block is selected, except on the home page, where it is redefined.

questions:

Is one of the solutions better in terms of performance, computing cost or maintenance?
Or another solution I haven’t thought of?

It should be neglibable, but if I would guess, I would say that the define blockTitle would be slightly faster.

The only one may be my hackish thougts about passing data up to the base templates in:

3 Likes