-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liningzhu
committed
Jan 8, 2024
1 parent
426e5a0
commit bdc829d
Showing
16 changed files
with
167 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,9 @@ | |
"author": "[email protected]", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/react-beautiful-dnd": "^13.1.7", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"@types/react-beautiful-dnd": "^13.1.7", | ||
"@vite-pwa/assets-generator": "^0.0.7", | ||
"@vitejs/plugin-react": "^4.0.3", | ||
"classnames": "^2.3.1", | ||
|
@@ -34,6 +34,7 @@ | |
"@buitar/to-guitar": "workspace:*", | ||
"@buitar/tone-player": "workspace:*", | ||
"react-beautiful-dnd": "^13.1.1", | ||
"react-helmet-async": "^2.0.4", | ||
"vexflow": "^4.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { FC } from 'react' | ||
import { Helmet } from 'react-helmet-async' | ||
import { pagesIntroConfig } from '@/pages/pages.config' | ||
import { useTopRoute, useRouteMatch } from '@/utils/hooks/use-routers' | ||
|
||
export const PagesMeta: FC<{ title?: string; decsription?: string }> = ({ | ||
title, | ||
decsription = '', | ||
}) => { | ||
const curTopRoute = useTopRoute() // 一级路由 | ||
const curRoute = useRouteMatch() | ||
if (!curTopRoute?.id) { | ||
return null | ||
} | ||
|
||
const pageInfo = pagesIntroConfig.get(curTopRoute.id) | ||
|
||
if (!pageInfo) { | ||
return null | ||
} | ||
const ogTitle = `${title || curRoute.name ||curTopRoute.name || pageInfo.title} - Buitar` | ||
const ogDescription = | ||
(decsription || `${pageInfo.title} - ${pageInfo.content.join(',') || 'Buitar'}`).slice(0, 150) | ||
const ogImage = 'https://i1.wp.com/img.erpweb.eu.org/imgs/2024/01/63842433f6b0627a.png' // https://img.erpweb.eu.org/imgs/2024/01/63842433f6b0627a.png | ||
return ( | ||
<Helmet> | ||
<title>{ogTitle}</title> | ||
<meta name="description" content={ogDescription} /> | ||
<meta property="og:title" content={ogTitle} /> | ||
<meta property="og:description" content={ogDescription} /> | ||
<meta property="og:image" content={ogImage} /> | ||
<link rel="canonical" href={location.href} /> | ||
</Helmet> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.