aderktech-chronark.com-/.contentlayer/.cache/v0.3.0/compiled-contentlayer-config-KFUTZ636.mjs
2023-02-27 20:19:40 +01:00

99 lines
2.2 KiB
JavaScript

// contentlayer.config.js
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import remarkGfm from "remark-gfm";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
var computedFields = {
path: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`
},
slug: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/")
}
};
var Project = defineDocumentType(() => ({
name: "Project",
filePathPattern: "./projects/**/*.mdx",
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string",
required: true
},
date: {
type: "date"
},
url: {
type: "string"
},
repository: {
type: "string"
}
},
computedFields
}));
var Page = defineDocumentType(() => ({
name: "Page",
filePathPattern: "pages/**/*.mdx",
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string"
}
},
computedFields
}));
var contentlayer_config_default = makeSource({
contentDirPath: "./content",
documentTypes: [Page, Project],
mdx: {
remarkPlugins: [remarkGfm],
rehypePlugins: [
rehypeSlug,
[
rehypePrettyCode,
{
theme: "github-dark",
onVisitLine(node) {
if (node.children.length === 0) {
node.children = [{ type: "text", value: " " }];
}
},
onVisitHighlightedLine(node) {
node.properties.className.push("line--highlighted");
},
onVisitHighlightedWord(node) {
node.properties.className = ["word--highlighted"];
}
}
],
[
rehypeAutolinkHeadings,
{
properties: {
className: ["subheading-anchor"],
ariaLabel: "Link to section"
}
}
]
]
}
});
export {
Page,
Project,
contentlayer_config_default as default
};
//# sourceMappingURL=compiled-contentlayer-config-KFUTZ636.mjs.map