starter-blog/components/Tag.js
Timothy 735c954e72
Feat/sub-route (#38)
* blog subroute support
* docs: update readme and blog

Co-authored-by: mrhut10 <ahut10@gmail.com>
2021-05-08 13:58:57 +08:00

15 lines
361 B
JavaScript

import Link from 'next/link'
import kebabCase from '@/lib/utils/kebabCase'
const Tag = ({ text }) => {
return (
<Link href={`/tags/${kebabCase(text)}`}>
<a className="mr-3 text-sm font-medium text-blue-500 uppercase hover:text-blue-600 dark:hover:text-blue-400">
{text.split(' ').join('-')}
</a>
</Link>
)
}
export default Tag