upstream #1
@ -1,5 +1,5 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import kebabCase from 'just-kebab-case'
|
import { kebabCase } from '@/lib/utils'
|
||||||
|
|
||||||
const Tag = ({ text }) => {
|
const Tag = ({ text }) => {
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import matter from 'gray-matter'
|
import matter from 'gray-matter'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import kebabCase from 'just-kebab-case'
|
import { kebabCase } from './utils'
|
||||||
|
|
||||||
const root = process.cwd()
|
const root = process.cwd()
|
||||||
|
|
||||||
|
6
lib/utils.js
Normal file
6
lib/utils.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export const kebabCase = (str) =>
|
||||||
|
str &&
|
||||||
|
str
|
||||||
|
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
||||||
|
.map((x) => x.toLowerCase())
|
||||||
|
.join('-')
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -5646,11 +5646,6 @@
|
|||||||
"object.assign": "^4.1.2"
|
"object.assign": "^4.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"just-kebab-case": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/just-kebab-case/-/just-kebab-case-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-QkuwuBMQ9BQHMUEkAtIA4INLrkmnnveqlFB1oFi09gbU0wBdZo6tTnyxNWMR84zHxBuwK7GLAwqN8nrvVxOLTA=="
|
|
||||||
},
|
|
||||||
"katex": {
|
"katex": {
|
||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/katex/-/katex-0.12.0.tgz",
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
"autoprefixer": "^10.1.0",
|
"autoprefixer": "^10.1.0",
|
||||||
"gray-matter": "^4.0.2",
|
"gray-matter": "^4.0.2",
|
||||||
"image-size": "0.9.3",
|
"image-size": "0.9.3",
|
||||||
"just-kebab-case": "^1.1.0",
|
|
||||||
"next": "10.0.5",
|
"next": "10.0.5",
|
||||||
"next-mdx-remote": "^2.0.0",
|
"next-mdx-remote": "^2.0.0",
|
||||||
"next-seo": "4.17.0",
|
"next-seo": "4.17.0",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import kebabCase from 'just-kebab-case'
|
|
||||||
import siteMetadata from '@/data/siteMetadata'
|
import siteMetadata from '@/data/siteMetadata'
|
||||||
|
import { kebabCase } from '@/lib/utils'
|
||||||
import { getAllTags } from '@/lib/tags'
|
import { getAllTags } from '@/lib/tags'
|
||||||
import Tag from '@/components/Tag'
|
import Tag from '@/components/Tag'
|
||||||
import Link from '@/components/Link'
|
import Link from '@/components/Link'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import kebabCase from 'just-kebab-case'
|
import { kebabCase } from '@/lib/utils'
|
||||||
import { getAllFilesFrontMatter } from '@/lib/mdx'
|
import { getAllFilesFrontMatter } from '@/lib/mdx'
|
||||||
import { getAllTags } from '@/lib/tags'
|
import { getAllTags } from '@/lib/tags'
|
||||||
import siteMetadata from '@/data/siteMetadata'
|
import siteMetadata from '@/data/siteMetadata'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user