Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Feat/#500 ] prerender 파이프라인 구축 후 글 페이지에 대한 dynamic og meta tag 추가 #517

Merged
merged 6 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 0 additions & 284 deletions public/mockServiceWorker.js

This file was deleted.

1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

27 changes: 0 additions & 27 deletions src/pages/postDetail/PostDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import styled from '@emotion/styled';
import { useEffect, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';

import { Helmet } from 'react-helmet-async';
import { useParams } from 'react-router-dom';
import { DefaultModal, DefaultModalBtn } from '../../components/commons/modal/DefaultModal';
import Responsive from '../../components/commons/Responsive/Responsive';
Expand Down Expand Up @@ -108,32 +107,6 @@ const PostDetail = () => {

return (
<>
<Helmet>
<title>{`MILE - ${postData?.title}`}</title>
<meta property="og:title" content={postData?.title} />
<meta
property="og:description"
content={
// '오직 글쓰기 모임을 위한 블로그, 마일에서 모임원들과 함께 글을 쓰며 여러분 만의 공간을 만들어보세요'
'test'
}
></meta>
<meta property="og:image" content={postData?.imageUrl} />
<meta name="keyword" content={`글쓰기, 글, 글모임, mile, MILE, 마일, ${postData?.title}`} />
<meta
property="og:url"
content={`https://www.milewriting.com/detail/${groupId}/${postId}`}
/>
</Helmet>
{/* <Helmet prioritizeSeoTags>
<title>A fancy webpage</title>
<link rel="notImportant" href="https://www.chipotle.com" />
<meta name="whatever" />
<meta property="og:image" content={postData?.imageUrl} />
<link rel="canonical" href="https://www.tacobell.com" />
<meta property="og:title" content="A very important title" />
</Helmet> */}

{accessToken ? <AuthorizationHeader /> : <UnAuthorizationHeader />}
<Responsive only="desktop">
<Spacing marginBottom="6.4" />
Expand Down
Empty file removed src/utils/crawler.ts
Empty file.
22 changes: 22 additions & 0 deletions src/utils/generateDynamicRoute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { allPostParsing } from './allPostParsing';

type GroupPostIdentifierTypes = {
groupId: string;
postId: string;
};

export const generateDynamicRoutes = async (apiURL: string) => {
const dynamicRoutes: string[] = []; // 동적 경로 저장 배열

try {
const data: GroupPostIdentifierTypes[] = await allPostParsing(apiURL);

data.map((items: GroupPostIdentifierTypes) => {
dynamicRoutes.push(`/detail/${items.groupId}/${items.postId}`); // 동적경로 리스트
});
} catch (e) {
console.log(e);
}

return dynamicRoutes;
};
Loading
Loading