-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 41b39d4
Showing
130 changed files
with
21,238 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,35 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
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,36 @@ | ||
# Studio | ||
|
||
Studio is a [Tailwind UI](https://tailwindui.com) site template built using [Tailwind CSS](https://tailwindcss.com) and [Next.js](https://nextjs.org). | ||
|
||
## Getting started | ||
|
||
To get started with this template, first install the npm dependencies: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
Next, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
Finally, open [http://localhost:3000](http://localhost:3000) in your browser to view the website. | ||
|
||
## Customizing | ||
|
||
You can start editing this template by modifying the files in the `/src` folder. The site will auto-update as you edit these files. | ||
|
||
## License | ||
|
||
This site template is a commercial product and is licensed under the [Tailwind UI license](https://tailwindui.com/license). | ||
|
||
## Learn more | ||
|
||
To learn more about the technologies used in this site template, see the following resources: | ||
|
||
- [Tailwind CSS](https://tailwindcss.com/docs) - the official Tailwind CSS documentation | ||
- [Next.js](https://nextjs.org/docs) - the official Next.js documentation | ||
- [Framer Motion](https://www.framer.com/docs/) - the official Framer Motion documentation | ||
- [MDX](https://mdxjs.com/) - the official MDX documentation |
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,10 @@ | ||
import { type MDXComponents as MDXComponentsType } from 'mdx/types' | ||
|
||
import { MDXComponents } from '@/components/MDXComponents' | ||
|
||
export function useMDXComponents(components: MDXComponentsType) { | ||
return { | ||
...components, | ||
...MDXComponents, | ||
} | ||
} |
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,83 @@ | ||
import rehypeShiki from '@leafac/rehype-shiki' | ||
import nextMDX from '@next/mdx' | ||
import { Parser } from 'acorn' | ||
import jsx from 'acorn-jsx' | ||
import escapeStringRegexp from 'escape-string-regexp' | ||
import * as path from 'path' | ||
import { recmaImportImages } from 'recma-import-images' | ||
import remarkGfm from 'remark-gfm' | ||
import { remarkRehypeWrap } from 'remark-rehype-wrap' | ||
import remarkUnwrapImages from 'remark-unwrap-images' | ||
import shiki from 'shiki' | ||
import { unifiedConditional } from 'unified-conditional' | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], | ||
} | ||
|
||
function remarkMDXLayout(source, metaName) { | ||
let parser = Parser.extend(jsx()) | ||
let parseOptions = { ecmaVersion: 'latest', sourceType: 'module' } | ||
|
||
return (tree) => { | ||
let imp = `import _Layout from '${source}'` | ||
let exp = `export default function Layout(props) { | ||
return <_Layout {...props} ${metaName}={${metaName}} /> | ||
}` | ||
|
||
tree.children.push( | ||
{ | ||
type: 'mdxjsEsm', | ||
value: imp, | ||
data: { estree: parser.parse(imp, parseOptions) }, | ||
}, | ||
{ | ||
type: 'mdxjsEsm', | ||
value: exp, | ||
data: { estree: parser.parse(exp, parseOptions) }, | ||
}, | ||
) | ||
} | ||
} | ||
|
||
export default async function config() { | ||
let highlighter = await shiki.getHighlighter({ | ||
theme: 'css-variables', | ||
}) | ||
|
||
let withMDX = nextMDX({ | ||
extension: /\.mdx$/, | ||
options: { | ||
recmaPlugins: [recmaImportImages], | ||
rehypePlugins: [ | ||
[rehypeShiki, { highlighter }], | ||
[ | ||
remarkRehypeWrap, | ||
{ | ||
node: { type: 'mdxJsxFlowElement', name: 'Typography' }, | ||
start: ':root > :not(mdxJsxFlowElement)', | ||
end: ':root > mdxJsxFlowElement', | ||
}, | ||
], | ||
], | ||
remarkPlugins: [ | ||
remarkGfm, | ||
remarkUnwrapImages, | ||
[ | ||
unifiedConditional, | ||
[ | ||
new RegExp(`^${escapeStringRegexp(path.resolve('src/app/blog'))}`), | ||
[[remarkMDXLayout, '@/app/blog/wrapper', 'article']], | ||
], | ||
[ | ||
new RegExp(`^${escapeStringRegexp(path.resolve('src/app/work'))}`), | ||
[[remarkMDXLayout, '@/app/work/wrapper', 'caseStudy']], | ||
], | ||
], | ||
], | ||
}, | ||
}) | ||
|
||
return withMDX(nextConfig) | ||
} |
Oops, something went wrong.