feat(seo): 期刊列表、期刊详情

feature/artists
mackt 7 months ago
parent ef13661b95
commit ba8514d6a2

@ -5,7 +5,7 @@ import DownloadCard from '@/app/download/components/DownloadCard';
import type { Metadata } from 'next'; import type { Metadata } from 'next';
export const metadata: Metadata = { export const metadata: Metadata = {
title: '下载', title: 'APP下载',
}; };
const qrCodeList: Array<DownloadQrcodeCard> = [ const qrCodeList: Array<DownloadQrcodeCard> = [

@ -12,7 +12,8 @@ export const metadata: Metadata = {
template: '%s - 雀乐', template: '%s - 雀乐',
default: '雀乐', default: '雀乐',
}, },
description: '独立 不独于世', description:
'雀乐是由一群喜欢并热爱独立音乐的人共同创建的,我们致力于传播来自世界各地的独立音乐。我们秉着音乐里独立自主的精神表达内核,希望把雀乐建设成为泛华语地区最好的独立音乐传播平台。',
icons: { icons: {
icon: '/favicon.ico', icon: '/favicon.ico',
}, },

@ -4,11 +4,17 @@ import { notFound } from 'next/navigation';
import { Category, JournalRecommendList, JournalItem, Pagination, RedirectCheck, ButtonFM } from '@/components'; import { Category, JournalRecommendList, JournalItem, Pagination, RedirectCheck, ButtonFM } from '@/components';
import { apiSearchCategoryList, apiGetJournalRecommendWithCollect, apiJournalList } from '@/services'; import { apiSearchCategoryList, apiGetJournalRecommendWithCollect, apiJournalList } from '@/services';
import type { Metadata } from 'next'; // export const metadata: Metadata = {
// title: '期刊',
// };
export const metadata: Metadata = { export async function generateMetadata({ params: { category } }: { params: { category?: string } }) {
title: '期刊', if (category && category !== 'all') {
}; const categoryList = await getCategoryList();
const categoryInfo: Category | undefined = categoryList.find((item: Category) => item.nameEn === category);
return { title: categoryInfo?.nameCh, descrition: categoryInfo?.description };
}
}
const getCategoryList = async () => { const getCategoryList = async () => {
const result = await apiSearchCategoryList(); const result = await apiSearchCategoryList();

@ -6,8 +6,8 @@ import { apiGetJournalInfoById, apiGetSongsByJournalNo, apiGetJournalRecommendBy
export async function generateMetadata({ params: { journalId } }: { params: { journalId: string } }) { export async function generateMetadata({ params: { journalId } }: { params: { journalId: string } }) {
const res = await apiGetJournalInfoById({ id: journalId }); const res = await apiGetJournalInfoById({ id: journalId });
const title = res.code === 200 ? res.data.title : '期刊详情'; const journalInfo = res.data;
return { title }; return { title: journalInfo.title, descrition: journalInfo.summary };
} }
const getData = async (journalId: string) => { const getData = async (journalId: string) => {

Loading…
Cancel
Save