mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-11 04:35:55 -04:00
theme: Improve search output
For pages with h6 only (e.g. frequently asked questions).
This commit is contained in:
parent
7e6b81ffa6
commit
49a2e7d71b
@ -14,13 +14,19 @@ const applyHelperFuncs = (array) => {
|
|||||||
item.getHeadingHTML = function () {
|
item.getHeadingHTML = function () {
|
||||||
let lvl2 = this._highlightResult.hierarchy.lvl2;
|
let lvl2 = this._highlightResult.hierarchy.lvl2;
|
||||||
let lvl3 = this._highlightResult.hierarchy.lvl3;
|
let lvl3 = this._highlightResult.hierarchy.lvl3;
|
||||||
if (!lvl2) {
|
|
||||||
|
if (!lvl3) {
|
||||||
|
if (lvl2) {
|
||||||
|
return lvl2.value;
|
||||||
|
}
|
||||||
return '';
|
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;
|
return item;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user