mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 17:07:08 +02:00
chore(v2): use single method package instead of whole Lodash package in blog plugin (#2460)
This commit is contained in:
parent
16a84998da
commit
85c124e3f1
2 changed files with 3 additions and 3 deletions
|
@ -20,7 +20,7 @@
|
||||||
"fs-extra": "^8.1.0",
|
"fs-extra": "^8.1.0",
|
||||||
"globby": "^10.0.1",
|
"globby": "^10.0.1",
|
||||||
"loader-utils": "^1.2.3",
|
"loader-utils": "^1.2.3",
|
||||||
"lodash": "^4.17.15"
|
"lodash.kebabcase": "^4.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@docusaurus/core": "^2.0.0",
|
"@docusaurus/core": "^2.0.0",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import _ from 'lodash';
|
import kebabCase from 'lodash.kebabcase';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {normalizeUrl, docuHash, aliasedSitePath} from '@docusaurus/utils';
|
import {normalizeUrl, docuHash, aliasedSitePath} from '@docusaurus/utils';
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ export default function pluginContentBlog(
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
blogPost.metadata.tags = tags.map(tag => {
|
blogPost.metadata.tags = tags.map(tag => {
|
||||||
if (typeof tag === 'string') {
|
if (typeof tag === 'string') {
|
||||||
const normalizedTag = _.kebabCase(tag);
|
const normalizedTag = kebabCase(tag);
|
||||||
const permalink = normalizeUrl([tagsPath, normalizedTag]);
|
const permalink = normalizeUrl([tagsPath, normalizedTag]);
|
||||||
if (!blogTags[normalizedTag]) {
|
if (!blogTags[normalizedTag]) {
|
||||||
blogTags[normalizedTag] = {
|
blogTags[normalizedTag] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue