Skip to content

Commit 6c87e35

Browse files
PxlSylPxlSyl
PxlSyl
authored and
PxlSyl
committed
update github-slugger pckg
1 parent 7f02c6e commit 6c87e35

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"contentlayer": "0.3.4",
2020
"esbuild": "0.18.11",
2121
"framer-motion": "^10.16.12",
22-
"github-slugger": "^1.4.0",
22+
"github-slugger": "^2.0.0",
2323
"gray-matter": "^4.0.2",
2424
"i18next": "^23.6.0",
2525
"i18next-browser-languagedetector": "^7.1.0",

scripts/postContentlayer.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* workaround script for windows users only, see there : https://github.com/timlrx/tailwind-nextjs-starter-blog/issues/704
22
command : node ./scripts/postContentlayer.mjs */
33
import { writeFileSync } from 'fs'
4-
import GithubSlugger from 'github-slugger'
4+
import { slug } from 'github-slugger'
55
import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer.js'
66
import { allBlogs } from '../.contentlayer/generated/index.mjs'
77
import siteMetadata from '../data/siteMetadata.js'
@@ -40,7 +40,7 @@ export async function createTagCount() {
4040
allBlogs.forEach((file) => {
4141
if (file.tags && (!isProduction || file.draft !== true)) {
4242
file.tags.forEach((tag) => {
43-
const formattedTag = GithubSlugger.slug(tag)
43+
const formattedTag = slug(tag)
4444
if (file.language === fallbackLng) {
4545
tagCount[fallbackLng][formattedTag] = (tagCount[fallbackLng][formattedTag] || 0) + 1
4646
} else if (file.language === secondLng) {

scripts/rss.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { writeFileSync, mkdirSync } from 'fs'
22
import path from 'path'
3-
import GithubSlugger from 'github-slugger'
3+
import { slug } from 'github-slugger'
44
import { escape } from 'pliny/utils/htmlEscaper.js'
55
import siteMetadata from '../data/siteMetadata.js'
66
import tagData from '../app/[locale]/tag-data.json' assert { type: 'json' }
@@ -55,7 +55,7 @@ async function generateRSS(config, allBlogs, locale, page = 'feed.xml') {
5555
if (publishPosts.length > 0) {
5656
for (const tag of Object.keys(tagData)) {
5757
const filteredPosts = publishPosts.filter((post) =>
58-
post.tags.map((t) => GithubSlugger.slug(t)).includes(tag)
58+
post.tags.map((t) => slug(t)).includes(tag)
5959
)
6060
const rss = generateRss(config, filteredPosts, `tags/${tag}/${page}`)
6161
const rssPath = path.join('public', locale, 'tags', tag)

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -11155,7 +11155,7 @@ __metadata:
1115511155
eslint-config-prettier: "npm:^8.8.0"
1115611156
eslint-plugin-prettier: "npm:^5.0.0"
1115711157
framer-motion: "npm:^10.16.12"
11158-
github-slugger: "npm:^1.4.0"
11158+
github-slugger: "npm:^2.0.0"
1115911159
gray-matter: "npm:^4.0.2"
1116011160
husky: "npm:^8.0.0"
1116111161
i18next: "npm:^23.6.0"

0 commit comments

Comments
 (0)