현재 기술 스택

세팅

  1. 패키지 설치

    npm install rehype rehype-pretty-code remark-gfm shiki
    
  2. contentLayer.config 설정

    const rehypeOptions = {
    	theme: 'github-dark-dimmed',
    	keepBackground: true,
    	defaultLang: 'plain text',
    };
    
    export default makeSource({
      contentDirPath: 'posts',
      documentTypes: [Post],
      mdx: {
        remarkPlugins: [remarkGfm],
        rehypePlugins: [[rehypePrettyCode, rehypeOptions]],
      },
    });
    
  3. 세부 설정 : rehype-pretty-code 참고