aderktech-chronark.com-/.contentlayer/.cache/v0.3.0/compiled-contentlayer-config-AAEZAM7W.mjs
Andreas Thomas d13531c222
redesign
2023-03-26 12:29:53 +02:00

98 lines
2.0 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: {
published: {
type: "boolean",
},
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-AAEZAM7W.mjs.map