Nova rubrika /aktuelles: splosne novice locene od naslovnice, povezava v glavi in nogi, v sitemapu
This commit is contained in:
@@ -20,8 +20,9 @@ interface PaginatedResponse {
|
||||
hasMore: boolean;
|
||||
}
|
||||
|
||||
export default function CategoryPage() {
|
||||
const { category } = useParams<{ category: string }>();
|
||||
export default function CategoryPage({ fixedCategory }: { fixedCategory?: string } = {}) {
|
||||
const params = useParams<{ category: string }>();
|
||||
const category = fixedCategory || params.category;
|
||||
const searchString = useSearch();
|
||||
const [, setLocation] = useLocation();
|
||||
|
||||
|
||||
@@ -711,10 +711,17 @@ export default function Home() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const { data: articles, isLoading } = useQuery<Article[]>({
|
||||
const { data: allArticles, isLoading } = useQuery<Article[]>({
|
||||
queryKey: ["/api/articles"],
|
||||
});
|
||||
|
||||
// Splosne novice imajo svojo rubriko /aktuelles in ne sodijo na naslovnico,
|
||||
// ki ostaja Volksmusik in Schlager.
|
||||
const articles = useMemo(
|
||||
() => (allArticles || []).filter((a) => a.category !== "Aktuelles"),
|
||||
[allArticles]
|
||||
);
|
||||
|
||||
const { data: popular } = useQuery<Article[]>({
|
||||
queryKey: ["/api/articles/popular"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user