Skip to content

Commit

Permalink
fix docs site
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Jul 20, 2023
1 parent 62c9be9 commit c486fdc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
19 changes: 6 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions website/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.


2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"devDependencies": {
"@boost/module": "^4.1.0",
"@types/mdast": "^4.0.0",
"@types/mdast": "^3.0.1",
"@types/react": "^18.2.15",
"@types/tailwindcss": "^3.1.0",
"autoprefixer": "^10.4.14",
Expand Down
12 changes: 6 additions & 6 deletions website/util/build-index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFileSync } from 'fs';
import path from 'path';
import url from 'url';
import { Content, Parent, Root } from 'mdast';
import { writeFileSync } from 'node:fs';
import path from 'node:path';
import url from 'node:url';
import type { Content, Parent } from 'mdast';
import slug from 'rehype-slug';
import rehypeStringify from 'rehype-stringify';
import { remark } from 'remark';
Expand Down Expand Up @@ -36,7 +36,7 @@ const docsIndex = docs.map((doc) => {
function markdownSections(file: MDXFile) {
const tree = docsProcessor.runSync(docsProcessor.parse(file.content));
const firstNode = tree.children[0];
const headings: (Parent | Content | null)[] = [firstNode.type === 'heading' ? firstNode : null];
const headings = [firstNode.type === 'heading' ? firstNode : null];

const sections = [
{
Expand All @@ -63,7 +63,7 @@ function markdownSections(file: MDXFile) {
const html = chunkProcessor.stringify(chunkProcessor.runSync(section));
const id = headings[i]
? chunkProcessor
.stringify(chunkProcessor.runSync(headings[i]! as Root))
.stringify(chunkProcessor.runSync(headings[i]! as never))
.match(/<h\d id="([^"]+)"/)?.[1] ?? ''
: '';

Expand Down

1 comment on commit c486fdc

@vercel
Copy link

@vercel vercel bot commented on c486fdc Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.