Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ next-env.d.ts
# contentlayer
.contentlayer

# search index file generated on build
/public/search.json

# IDEs
.idea

Expand Down
19 changes: 0 additions & 19 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode from 'rehype-pretty-code';
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import {MDXDocument, allCoreContent} from './src/utils/contentlayer';
import {searchMetadata} from './src/data/search';
import GithubSlugger from 'github-slugger';
import {visit} from 'unist-util-visit';

Expand Down Expand Up @@ -81,19 +79,6 @@ export const Post = defineDocumentType(() => ({
}
}));

function createSearchIndex(allPosts: MDXDocument[]) {
if (
searchMetadata?.provider === 'kbar' &&
searchMetadata.kbarConfig.searchDocumentsPath
) {
fs.writeFileSync(
`public/search.json`,
JSON.stringify(allCoreContent(allPosts))
);
console.log('Search index generated...');
}
}

const prettyCodeOptions = {
keepBackground: true,
theme: JSON.parse(
Expand Down Expand Up @@ -145,9 +130,5 @@ export default makeSource({
rehypePlugins: rehypePlugins,
// Externalize mermaid to prevent bundling its problematic Unicode regex patterns
esbuildOptions: options => ({...options, external: [...(options.external ?? []), 'mermaid']})
},
onSuccess: async importData => {
const {allPosts} = await importData();
createSearchIndex(allPosts);
}
});
1 change: 0 additions & 1 deletion cspell-allow-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ journalctl
Jsonnet
jsonschemadoc
Kaspersky
kbar
keegancsmith
keymap
keymappings
Expand Down
3 changes: 0 additions & 3 deletions src/components/MdxComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ const MdxComponents = (version?: string) => {
img: (props: any) => {
return <ZoomableImage {...props} />;
},
video: (props: any) => {
return <video className="rounded-xl" {...props} />;
},
pre: (props: any) => <PreCodeBlock {...props} />,
table: (props: any) => (
<div {...props} className="w-full table-auto overflow-x-auto">
Expand Down
6 changes: 0 additions & 6 deletions src/data/search.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
export const searchMetadata = {
provider: 'kbar',
kbarConfig: {
searchDocumentsPath: '/docs/search.json' // path to load documents to search
},
// For Algolia
// provider: 'algolia',
algoliaConfig: {
// The application ID provided by Algolia
appId: '0EBA2NRQU3',
Expand Down
65 changes: 0 additions & 65 deletions src/utils/contentlayer.ts

This file was deleted.

Loading