mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
theme: Improve search output
For pages with h6 only (e.g. frequently asked questions).
This commit is contained in:
@@ -14,13 +14,19 @@ const applyHelperFuncs = (array) => {
|
||||
item.getHeadingHTML = function () {
|
||||
let lvl2 = this._highlightResult.hierarchy.lvl2;
|
||||
let lvl3 = this._highlightResult.hierarchy.lvl3;
|
||||
if (!lvl2) {
|
||||
|
||||
if (!lvl3) {
|
||||
if (lvl2) {
|
||||
return lvl2.value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
if (lvl3) {
|
||||
return `${lvl2.value} <span class="text-gray-500"> > </span> ${lvl3.value}`;
|
||||
|
||||
if (!lvl2) {
|
||||
return lvl3.value;
|
||||
}
|
||||
return lvl2.value;
|
||||
|
||||
return `${lvl2.value} <span class="text-gray-500"> > </span> ${lvl3.value}`;
|
||||
};
|
||||
return item;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user