Skip to content

Commit

Permalink
feat: infosec site WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
okhaimie-dev committed Oct 6, 2023
0 parents commit 41b39d4
Show file tree
Hide file tree
Showing 130 changed files with 21,238 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions .gitignore
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
36 changes: 36 additions & 0 deletions README.md
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
10 changes: 10 additions & 0 deletions mdx-components.tsx
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,
}
}
83 changes: 83 additions & 0 deletions next.config.mjs
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)
}
Loading

0 comments on commit 41b39d4

Please sign in to comment.