mirror of
https://github.com/AderKonstantin/aderktech-chronark.com-.git
synced 2025-06-08 05:38:41 +03:00
97 lines
2.0 KiB
JavaScript
97 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: {
|
|
title: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
description: {
|
|
type: "string",
|
|
},
|
|
date: {
|
|
type: "date",
|
|
required: true,
|
|
},
|
|
url: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
repository: {
|
|
type: "string",
|
|
required: true,
|
|
},
|
|
},
|
|
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, Author, Tech],
|
|
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-45X2WG6B.mjs.map
|