mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Removed author and tag sections with invalid urls
refs https://github.com/TryGhost/Team/issues/1665 - if taxonomy is disabled, author and tag urls are 404s. - removes author/tag section if 404
This commit is contained in:
parent
64bb0b3c50
commit
eb59bea5c7
1 changed files with 12 additions and 2 deletions
|
@ -148,8 +148,8 @@ function SearchClearIcon() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Loading() {
|
function Loading() {
|
||||||
const {indexComplete} = useContext(AppContext);
|
const {indexComplete, searchValue} = useContext(AppContext);
|
||||||
if (!indexComplete) {
|
if (!indexComplete && searchValue) {
|
||||||
return (
|
return (
|
||||||
<CircleAnimated className='shrink-0' />
|
<CircleAnimated className='shrink-0' />
|
||||||
);
|
);
|
||||||
|
@ -448,6 +448,16 @@ function SearchResultBox() {
|
||||||
filteredTags = searchResults?.tags || [];
|
filteredTags = searchResults?.tags || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filteredAuthors = filteredAuthors.filter((author) => {
|
||||||
|
const invalidUrlRegex = /\/404\/$/;
|
||||||
|
return !(author?.url && invalidUrlRegex.test(author?.url));
|
||||||
|
});
|
||||||
|
|
||||||
|
filteredTags = filteredTags.filter((tag) => {
|
||||||
|
const invalidUrlRegex = /\/404\/$/;
|
||||||
|
return !(tag?.url && invalidUrlRegex.test(tag?.url));
|
||||||
|
});
|
||||||
|
|
||||||
const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length;
|
const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length;
|
||||||
|
|
||||||
if (hasResults) {
|
if (hasResults) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue