Fix links for next 13.
This commit is contained in:
@ -7,10 +7,10 @@ const CustomLink = ({ href, ...rest }) => {
|
|||||||
|
|
||||||
if (isInternalLink) {
|
if (isInternalLink) {
|
||||||
return (
|
return (
|
||||||
<Link href={href}>
|
(<Link href={href} {...rest}>
|
||||||
<a {...rest} />
|
|
||||||
</Link>
|
</Link>)
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAnchorLink) {
|
if (isAnchorLink) {
|
||||||
|
|||||||
@ -3,12 +3,14 @@ import kebabCase from '@/lib/utils/kebabCase'
|
|||||||
|
|
||||||
const Tag = ({ text }) => {
|
const Tag = ({ text }) => {
|
||||||
return (
|
return (
|
||||||
<Link href={`/tags/${kebabCase(text)}`}>
|
(<Link
|
||||||
<a className="mr-3 text-sm font-medium uppercase text-primary-800 hover:text-primary-900 dark:hover:text-primary-400">
|
href={`/tags/${kebabCase(text)}`}
|
||||||
{text.split(' ').join('-')}
|
className="mr-3 text-sm font-medium uppercase text-primary-800 hover:text-primary-900 dark:hover:text-primary-400">
|
||||||
</a>
|
|
||||||
</Link>
|
{text.split(' ').join('-')}
|
||||||
)
|
|
||||||
|
</Link>)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Tag
|
export default Tag
|
||||||
|
|||||||
@ -27,11 +27,11 @@ export function getFiles(type) {
|
|||||||
const prefixPaths = path.join(root, 'data', type)
|
const prefixPaths = path.join(root, 'data', type)
|
||||||
const files = getAllFilesRecursively(prefixPaths)
|
const files = getAllFilesRecursively(prefixPaths)
|
||||||
// Only want to return workshop/path and ignore root, replace is needed to work on Windows
|
// Only want to return workshop/path and ignore root, replace is needed to work on Windows
|
||||||
return files.map((file) => file.slice(prefixPaths.length + 1).replace(/\\/g, '/'))
|
return files.map((file) => file.slice(prefixPaths.length + 1).replace(/\\/g, '/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatSlug(slug) {
|
export function formatSlug(slug) {
|
||||||
return slug.replace(/\.(mdx|md)/, '')
|
return slug.replace(/\.(mdx|md)/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function dateSortAsc(a, b) {
|
export function dateSortAsc(a, b) {
|
||||||
|
|||||||
Reference in New Issue
Block a user