forked from Transparency/kgroad-frontend2
improved seo, made not-found page, fixed bugs in news details and in report datails pages
This commit is contained in:
1 parent
7d36510a9b
commit
ad86f2e79e
18 files changed
+224
-30
No files matched your search
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import NotFound from "@/widgets/NotFound/NotFound";
|
||||
|
||||
const error = () => {
|
||||
return <NotFound />;
|
||||
};
|
||||
|
||||
export default error;
|
||||
@@ -7,11 +7,33 @@ import message from "./icons/message.svg";
|
||||
import calendar from "./icons/calendar.svg";
|
||||
import ReviewSection from "@/widgets/ReviewSection/ReviewSection";
|
||||
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
}): Promise<Metadata> {
|
||||
const response = await apiInstance.get<INews>(
|
||||
`/news/${params.id}/`
|
||||
);
|
||||
|
||||
return {
|
||||
title: response.data.title,
|
||||
description: response.data.description,
|
||||
openGraph: {
|
||||
images: [response.data.image],
|
||||
type: "article",
|
||||
publishedTime: response.data.created_at,
|
||||
},
|
||||
keywords: ["Новости КР", "Дорожные происшествия", "Кыргызстан"],
|
||||
};
|
||||
}
|
||||
|
||||
const NewsDetails = async ({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
params: { id: string; новость: string };
|
||||
}) => {
|
||||
const getNewsById = async () => {
|
||||
const response = await apiInstance.get<INews>(
|
||||
|
||||
Reference in new issue
Block a user