Skip to content

Commit

Permalink
Remove MDX integration (#1141)
Browse files Browse the repository at this point in the history
Remove MDX integration to prevent MDX files being used going forward.
Update search to include markdoc files.

Test plan:
- Confirm dev server runs successfully
- Confirm site builds and previews successfully
- Confirm search index includes content from markdoc files
  • Loading branch information
tom-blake authored Dec 8, 2024
1 parent 168381f commit 792a662
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 587 deletions.
2 changes: 0 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import rehypeSectionize from '@hbsnow/rehype-sectionize';

// https://astro.build/config
import vue from '@astrojs/vue';
import mdx from '@astrojs/mdx';

import markdoc from '@astrojs/markdoc';
import expressiveCode from 'astro-expressive-code';
Expand All @@ -19,7 +18,6 @@ export default defineConfig({
vue(),
tailwind({ applyBaseStyles: false }),
expressiveCode(),
mdx(),
markdoc({ ignoreIndentation: true }),
],
markdown: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"devDependencies": {
"@astrojs/markdoc": "^0.11.5",
"@astrojs/mdx": "^3.1.7",
"@astrojs/tailwind": "^5.1.1",
"@astrojs/vue": "^4.5.2",
"@babel/eslint-parser": "^7.14.7",
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/flexsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ async function createFlexsearchIndexData() {
.use(remarkExtractSections)
.use(remarkHtml);

for (const filepath of await glob.sync('src/content/**/*.{md,mdx}')) {
const href = filepath.replace(/(src\/content)|\.(mdx?)/g, '');
for (const filepath of await glob.sync('src/content/**/*.{md,mdoc}')) {
const href = filepath.replace(/(src\/content)|\.(mdoc?)/g, '');
const { data: frontMatter, content } = grayMatter(await fs.readFile(filepath));
const path = [...frontMatter.nav.path.split('/'), frontMatter.nav.title ?? frontMatter.title];

Expand Down
Loading

0 comments on commit 792a662

Please sign in to comment.