Closed DmitrySharabin closed 6 months ago
The debugging showed that the title
computed property defined here
returns an empty string.
For some reason, data.title
is an empty string.
The investigation is to be continued...
Since data.title
is an empty string but data.tag
is not, we can fix (at least temporarily) the issue with this change (see line 19 above):
+ return data.title ?? data.tag;
- return data.title || data.tag;
But why is data.title
empty on component pages but not on the root page? The root page uses the page.njk
layout. This layout uses the default computed property title
defined in _data/eleventyComputed.js
(it extracts the default title from the content).
However, the layout, which uses component pages (component.njk
), re-defined the title
property to use either the title provided by the component (none of them is doing it) or the computed property tag
(defined in the same block).
Niether
<h1>
nor
<title>
(the generic one is used)