-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: David Moore <[email protected]> Co-authored-by: Ryan Cartwright <[email protected]>
- Loading branch information
1 parent
f60bf89
commit dfd5bac
Showing
1,349 changed files
with
65,222 additions
and
56,007 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
files: | ||
- 'src/pages/**/*.{md,mdx}' | ||
- 'docs/**/*.{md,mdx}' | ||
dictionaries: | ||
- dictionary.txt | ||
quiet: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": false, | ||
"style": "new-york", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"config": "tailwind.config.ts", | ||
"css": "src/styles/tailwind.css", | ||
"baseColor": "slate", | ||
"baseColor": "zinc", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
"utils": "@/lib/utils", | ||
"ui": "@/components/ui", | ||
"lib": "@/lib", | ||
"hooks": "@/hooks" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { defineDocumentType, makeSource } from 'contentlayer2/source-files' | ||
import { extractTocHeadings } from './src/mdx/remark-toc-headings.mjs' | ||
import path from 'path' | ||
import fs from 'fs' | ||
|
||
const contentDirPath = 'docs' | ||
|
||
const branch = process.env.NEXT_PUBLIC_GITHUB_BRANCH || 'main' | ||
|
||
const Doc = defineDocumentType(() => ({ | ||
name: 'Doc', | ||
filePathPattern: '**/*.mdx', | ||
fields: { | ||
title_seo: { | ||
type: 'string', | ||
description: | ||
'The meta title of the doc, this will override the title extracted from the markdown and the nav title', | ||
}, | ||
description: { | ||
type: 'string', | ||
description: 'The description of the doc', | ||
}, | ||
image: { | ||
type: 'string', | ||
description: 'The image of the doc', | ||
}, | ||
image_alt: { | ||
type: 'string', | ||
description: 'The image alt of the doc', | ||
}, | ||
disable_edit: { | ||
type: 'boolean', | ||
description: 'Disable the github edit button', | ||
}, | ||
tags: { | ||
type: 'list', | ||
of: { | ||
type: 'string', | ||
}, | ||
description: 'The tags of the post, used by guides', | ||
}, | ||
}, | ||
computedFields: { | ||
slug: { | ||
type: 'string', | ||
resolve: (doc) => doc._raw.flattenedPath, | ||
}, | ||
toc: { type: 'json', resolve: (doc) => extractTocHeadings(doc.body.raw) }, | ||
title: { | ||
type: 'string', | ||
resolve: async (doc) => { | ||
const headings = await extractTocHeadings(doc.body.raw, [1]) | ||
|
||
return headings[0]?.value | ||
}, | ||
}, | ||
editUrl: { | ||
type: 'string', | ||
resolve: (doc) => | ||
`https://github.com/nitrictech/docs/edit/${branch}/docs/${doc._raw.sourceFilePath}`, | ||
}, | ||
lastModified: { | ||
type: 'date', | ||
resolve: (doc) => { | ||
// Get the full path to the markdown file | ||
const filePath = path.join( | ||
process.cwd(), | ||
contentDirPath, | ||
doc._raw.sourceFilePath, | ||
) | ||
// Extract and return the last modified date | ||
const stats = fs.statSync(filePath) | ||
return stats.mtime // This is the last modified date | ||
}, | ||
}, | ||
}, | ||
})) | ||
|
||
export default makeSource({ | ||
contentDirPath, | ||
documentTypes: [Doc], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.