mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03: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
@ -148,8 +148,8 @@ function SearchClearIcon() {
|
||||
}
|
||||
|
||||
function Loading() {
|
||||
const {indexComplete} = useContext(AppContext);
|
||||
if (!indexComplete) {
|
||||
const {indexComplete, searchValue} = useContext(AppContext);
|
||||
if (!indexComplete && searchValue) {
|
||||
return (
|
||||
<CircleAnimated className='shrink-0' />
|
||||
);
|
||||
@ -448,6 +448,16 @@ function SearchResultBox() {
|
||||
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;
|
||||
|
||||
if (hasResults) {
|
||||
|
Loading…
Reference in New Issue
Block a user