Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: blog #12

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// contentlayer.config.js
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
var computedFields = {
slug: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`
},
slugAsParams: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/")
}
};
var Doc = defineDocumentType(() => ({
name: "Doc",
filePathPattern: `docs/**/*.mdx`,
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string"
},
published: {
type: "boolean",
default: true
}
},
computedFields
}));
var contentlayer_config_default = makeSource({
contentDirPath: "src/content",
documentTypes: [Doc],
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 {
Doc,
contentlayer_config_default as default
};
//# sourceMappingURL=compiled-contentlayer-config-CZCNH7P2.mjs.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../contentlayer.config.js"],
"sourcesContent": ["import { defineDocumentType, makeSource } from \"contentlayer/source-files\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport rehypePrettyCode from \"rehype-pretty-code\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkGfm from \"remark-gfm\";\n\n/** @type {import('contentlayer/source-files').ComputedFields} */\nconst computedFields = {\n slug: {\n type: \"string\",\n resolve: (doc) => `/${doc._raw.flattenedPath}`,\n },\n slugAsParams: {\n type: \"string\",\n resolve: (doc) => doc._raw.flattenedPath.split(\"/\").slice(1).join(\"/\"),\n },\n};\n\nexport const Doc = defineDocumentType(() => ({\n name: \"Doc\",\n filePathPattern: `docs/**/*.mdx`,\n contentType: \"mdx\",\n fields: {\n title: {\n type: \"string\",\n required: true,\n },\n description: {\n type: \"string\",\n },\n published: {\n type: \"boolean\",\n default: true,\n },\n },\n computedFields,\n}));\n\nexport default makeSource({\n contentDirPath: \"src/content\",\n documentTypes: [Doc],\n mdx: {\n remarkPlugins: [remarkGfm],\n rehypePlugins: [\n rehypeSlug,\n [\n rehypePrettyCode,\n {\n theme: \"github-dark\",\n onVisitLine(node) {\n // Prevent lines from collapsing in `display: grid` mode, and allow empty\n // lines to be copy/pasted\n if (node.children.length === 0) {\n node.children = [{ type: \"text\", value: \" \" }];\n }\n },\n onVisitHighlightedLine(node) {\n node.properties.className.push(\"line--highlighted\");\n },\n onVisitHighlightedWord(node) {\n node.properties.className = [\"word--highlighted\"];\n },\n },\n ],\n [\n rehypeAutolinkHeadings,\n {\n properties: {\n className: [\"subheading-anchor\"],\n ariaLabel: \"Link to section\",\n },\n },\n ],\n ],\n },\n});\n"],
"mappings": ";AAAA,SAAS,oBAAoB,kBAAkB;AAC/C,OAAO,4BAA4B;AACnC,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AAGtB,IAAM,iBAAiB;AAAA,EACrB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,IAAI,KAAK,aAAa;AAAA,EAC9C;AAAA,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,KAAK,cAAc,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG;AAAA,EACvE;AACF;AAEO,IAAM,MAAM,mBAAmB,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA;AACF,EAAE;AAEF,IAAO,8BAAQ,WAAW;AAAA,EACxB,gBAAgB;AAAA,EAChB,eAAe,CAAC,GAAG;AAAA,EACnB,KAAK;AAAA,IACH,eAAe,CAAC,SAAS;AAAA,IACzB,eAAe;AAAA,MACb;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP,YAAY,MAAM;AAGhB,gBAAI,KAAK,SAAS,WAAW,GAAG;AAC9B,mBAAK,WAAW,CAAC,EAAE,MAAM,QAAQ,OAAO,IAAI,CAAC;AAAA,YAC/C;AAAA,UACF;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,UAAU,KAAK,mBAAmB;AAAA,UACpD;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,YAAY,CAAC,mBAAmB;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,YAAY;AAAA,YACV,WAAW,CAAC,mBAAmB;AAAA,YAC/B,WAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
"names": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// contentlayer.config.js
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
var computedFields = {
slug: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`
},
slugAsParams: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/")
}
};
var Doc = defineDocumentType(() => ({
name: "Doc",
filePathPattern: `posts/**/*.mdx`,
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string"
},
published: {
type: "boolean",
default: true
},
publishedDate: {
type: "string"
}
},
computedFields
}));
var contentlayer_config_default = makeSource({
contentDirPath: "src/content",
documentTypes: [Doc],
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 {
Doc,
contentlayer_config_default as default
};
//# sourceMappingURL=compiled-contentlayer-config-F3AZMSCE.mjs.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../contentlayer.config.js"],
"sourcesContent": ["import { defineDocumentType, makeSource } from \"contentlayer/source-files\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport rehypePrettyCode from \"rehype-pretty-code\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkGfm from \"remark-gfm\";\n\n/** @type {import('contentlayer/source-files').ComputedFields} */\nconst computedFields = {\n slug: {\n type: \"string\",\n resolve: (doc) => `/${doc._raw.flattenedPath}`,\n },\n slugAsParams: {\n type: \"string\",\n resolve: (doc) => doc._raw.flattenedPath.split(\"/\").slice(1).join(\"/\"),\n },\n};\n\nexport const Doc = defineDocumentType(() => ({\n name: \"Doc\",\n filePathPattern: `posts/**/*.mdx`,\n contentType: \"mdx\",\n fields: {\n title: {\n type: \"string\",\n required: true,\n },\n description: {\n type: \"string\",\n },\n published: {\n type: \"boolean\",\n default: true,\n },\n publishedDate: {\n type: \"string\",\n },\n },\n computedFields,\n}));\n\nexport default makeSource({\n contentDirPath: \"src/content\",\n documentTypes: [Doc],\n mdx: {\n remarkPlugins: [remarkGfm],\n rehypePlugins: [\n rehypeSlug,\n [\n rehypePrettyCode,\n {\n theme: \"github-dark\",\n onVisitLine(node) {\n // Prevent lines from collapsing in `display: grid` mode, and allow empty\n // lines to be copy/pasted\n if (node.children.length === 0) {\n node.children = [{ type: \"text\", value: \" \" }];\n }\n },\n onVisitHighlightedLine(node) {\n node.properties.className.push(\"line--highlighted\");\n },\n onVisitHighlightedWord(node) {\n node.properties.className = [\"word--highlighted\"];\n },\n },\n ],\n [\n rehypeAutolinkHeadings,\n {\n properties: {\n className: [\"subheading-anchor\"],\n ariaLabel: \"Link to section\",\n },\n },\n ],\n ],\n },\n});\n"],
"mappings": ";AAAA,SAAS,oBAAoB,kBAAkB;AAC/C,OAAO,4BAA4B;AACnC,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AAGtB,IAAM,iBAAiB;AAAA,EACrB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,IAAI,KAAK,aAAa;AAAA,EAC9C;AAAA,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,KAAK,cAAc,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG;AAAA,EACvE;AACF;AAEO,IAAM,MAAM,mBAAmB,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA;AACF,EAAE;AAEF,IAAO,8BAAQ,WAAW;AAAA,EACxB,gBAAgB;AAAA,EAChB,eAAe,CAAC,GAAG;AAAA,EACnB,KAAK;AAAA,IACH,eAAe,CAAC,SAAS;AAAA,IACzB,eAAe;AAAA,MACb;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP,YAAY,MAAM;AAGhB,gBAAI,KAAK,SAAS,WAAW,GAAG;AAC9B,mBAAK,WAAW,CAAC,EAAE,MAAM,QAAQ,OAAO,IAAI,CAAC;AAAA,YAC/C;AAAA,UACF;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,UAAU,KAAK,mBAAmB;AAAA,UACpD;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,YAAY,CAAC,mBAAmB;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,YAAY;AAAA,YACV,WAAW,CAAC,mBAAmB;AAAA,YAC/B,WAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
"names": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// contentlayer.config.js
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
var computedFields = {
slug: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`
},
slugAsParams: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/")
}
};
var Doc = defineDocumentType(() => ({
name: "Doc",
filePathPattern: `posts/**/*.mdx`,
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string"
},
published: {
type: "boolean",
default: true
},
publishedData: {
type: "string"
}
},
computedFields
}));
var contentlayer_config_default = makeSource({
contentDirPath: "src/content",
documentTypes: [Doc],
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 {
Doc,
contentlayer_config_default as default
};
//# sourceMappingURL=compiled-contentlayer-config-K73M6UWJ.mjs.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../contentlayer.config.js"],
"sourcesContent": ["import { defineDocumentType, makeSource } from \"contentlayer/source-files\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\nimport rehypePrettyCode from \"rehype-pretty-code\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkGfm from \"remark-gfm\";\n\n/** @type {import('contentlayer/source-files').ComputedFields} */\nconst computedFields = {\n slug: {\n type: \"string\",\n resolve: (doc) => `/${doc._raw.flattenedPath}`,\n },\n slugAsParams: {\n type: \"string\",\n resolve: (doc) => doc._raw.flattenedPath.split(\"/\").slice(1).join(\"/\"),\n },\n};\n\nexport const Doc = defineDocumentType(() => ({\n name: \"Doc\",\n filePathPattern: `posts/**/*.mdx`,\n contentType: \"mdx\",\n fields: {\n title: {\n type: \"string\",\n required: true,\n },\n description: {\n type: \"string\",\n },\n published: {\n type: \"boolean\",\n default: true,\n },\n publishedData: {\n type: \"string\",\n },\n },\n computedFields,\n}));\n\nexport default makeSource({\n contentDirPath: \"src/content\",\n documentTypes: [Doc],\n mdx: {\n remarkPlugins: [remarkGfm],\n rehypePlugins: [\n rehypeSlug,\n [\n rehypePrettyCode,\n {\n theme: \"github-dark\",\n onVisitLine(node) {\n // Prevent lines from collapsing in `display: grid` mode, and allow empty\n // lines to be copy/pasted\n if (node.children.length === 0) {\n node.children = [{ type: \"text\", value: \" \" }];\n }\n },\n onVisitHighlightedLine(node) {\n node.properties.className.push(\"line--highlighted\");\n },\n onVisitHighlightedWord(node) {\n node.properties.className = [\"word--highlighted\"];\n },\n },\n ],\n [\n rehypeAutolinkHeadings,\n {\n properties: {\n className: [\"subheading-anchor\"],\n ariaLabel: \"Link to section\",\n },\n },\n ],\n ],\n },\n});\n"],
"mappings": ";AAAA,SAAS,oBAAoB,kBAAkB;AAC/C,OAAO,4BAA4B;AACnC,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AAGtB,IAAM,iBAAiB;AAAA,EACrB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,IAAI,KAAK,aAAa;AAAA,EAC9C;AAAA,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,KAAK,cAAc,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG;AAAA,EACvE;AACF;AAEO,IAAM,MAAM,mBAAmB,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA;AACF,EAAE;AAEF,IAAO,8BAAQ,WAAW;AAAA,EACxB,gBAAgB;AAAA,EAChB,eAAe,CAAC,GAAG;AAAA,EACnB,KAAK;AAAA,IACH,eAAe,CAAC,SAAS;AAAA,IACzB,eAAe;AAAA,MACb;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP,YAAY,MAAM;AAGhB,gBAAI,KAAK,SAAS,WAAW,GAAG;AAC9B,mBAAK,WAAW,CAAC,EAAE,MAAM,QAAQ,OAAO,IAAI,CAAC;AAAA,YAC/C;AAAA,UACF;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,UAAU,KAAK,mBAAmB;AAAA,UACpD;AAAA,UACA,uBAAuB,MAAM;AAC3B,iBAAK,WAAW,YAAY,CAAC,mBAAmB;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,YAAY;AAAA,YACV,WAAW,CAAC,mBAAmB;AAAA,YAC/B,WAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
"names": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// contentlayer.config.js
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
var computedFields = {
slug: {
type: "string",
resolve: (doc) => `/${doc._raw.flattenedPath}`
},
slugAsParams: {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/")
}
};
var Doc = defineDocumentType(() => ({
name: "Doc",
filePathPattern: `posts/**/*.mdx`,
contentType: "mdx",
fields: {
title: {
type: "string",
required: true
},
description: {
type: "string"
},
published: {
type: "boolean",
default: true
}
},
computedFields
}));
var contentlayer_config_default = makeSource({
contentDirPath: "src/content",
documentTypes: [Doc],
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 {
Doc,
contentlayer_config_default as default
};
//# sourceMappingURL=compiled-contentlayer-config-KFH5HZJX.mjs.map
Loading