Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit daee47d

Browse files
author
wlinator
committed
First Code of Conduct init
1 parent d1a15a9 commit daee47d

File tree

8 files changed

+130
-63
lines changed

8 files changed

+130
-63
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "code-of-conduct"]
2+
path = code-of-conduct
3+
url = https://github.com/allthingslinux/code-of-conduct

app/code-of-conduct/page.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/code-of-conduct/page.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import ReactMarkdown from 'react-markdown';
2+
import remarkGfm from 'remark-gfm';
3+
import { readFileSync } from 'fs';
4+
import path from 'path';
5+
6+
export default function CodeOfConduct() {
7+
// Read the contents of the README.md file
8+
const readmePath = path.join(process.cwd(), 'code-of-conduct', 'README.md');
9+
const readmeContent = readFileSync(readmePath, 'utf8');
10+
11+
// Remove header content before "Code of Conduct"
12+
const contentStartIndex = readmeContent.indexOf('# Code of Conduct');
13+
let cleanedContent = readmeContent.slice(contentStartIndex);
14+
15+
// Remove HTML comments and table of contents section
16+
cleanedContent = cleanedContent.replace(/<!--[\s\S]*?-->/g, '');
17+
const tocStart = cleanedContent.indexOf('**Table of Contents**');
18+
const tocEnd = cleanedContent.indexOf('## Preface');
19+
if (tocStart !== -1 && tocEnd !== -1) {
20+
cleanedContent =
21+
cleanedContent.slice(0, tocStart) +
22+
cleanedContent.slice(tocEnd);
23+
}
24+
25+
// Remove Contributors section
26+
const contributorsIndex = cleanedContent.indexOf('## Contributors');
27+
if (contributorsIndex !== -1) {
28+
cleanedContent = cleanedContent.slice(0, contributorsIndex);
29+
}
30+
31+
return (
32+
<div className="container mx-auto px-4 py-12 prose prose-invert max-w-7xl">
33+
<ReactMarkdown
34+
remarkPlugins={[remarkGfm]}
35+
components={{
36+
table: ({ node, ...props }) => (
37+
<div className="overflow-hidden rounded-lg border border-gray-700/50">
38+
<table {...props} className="w-full border-collapse" />
39+
</div>
40+
),
41+
thead: ({ node, ...props }) => (
42+
<thead {...props} className="bg-gray-900/30" />
43+
),
44+
th: ({ node, ...props }) => (
45+
<th {...props} className="p-3 text-left text-sm font-semibold text-gray-200" />
46+
),
47+
td: ({ node, ...props }) => (
48+
<td {...props} className="p-3 text-sm text-gray-300 border-t border-gray-700/50" />
49+
),
50+
tr: ({ node, ...props }) => (
51+
<tr {...props} className="hover:bg-gray-800/20 transition-colors" />
52+
),
53+
}}
54+
>
55+
{cleanedContent}
56+
</ReactMarkdown>
57+
</div>
58+
);
59+
}

app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ body {
118118
.carousel-blend::after {
119119
right: 0;
120120
background: linear-gradient(to left, #111827, transparent);
121-
}
121+
}

components/layout/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function Header() {
3232
</Link>
3333
<Link
3434
className="text-sm font-medium hover:text-slate-200 text-slate-400"
35-
href="#">
35+
href="/code-of-conduct">
3636
CoC
3737
</Link>
3838
<Link
@@ -79,7 +79,7 @@ export default function Header() {
7979
</Link>
8080
<Link
8181
className="text-sm font-medium hover:text-slate-200 text-slate-400"
82-
href="#">
82+
href="/code-of-conduct">
8383
CoC
8484
</Link>
8585
<Link

package-lock.json

Lines changed: 50 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030
"embla-carousel-auto-scroll": "^8.3.1",
3131
"embla-carousel-react": "^8.3.1",
3232
"framer-motion": "^11.11.11",
33+
"github-markdown-css": "^5.7.0",
3334
"lucide-react": "0.456.0",
3435
"next": "15.0.3",
3536
"prettier-eslint": "16.3.0",
3637
"react": "18",
3738
"react-dom": "18",
3839
"react-hook-form": "7.53.2",
3940
"react-icons": "5.3.0",
41+
"react-markdown": "^9.0.1",
4042
"react-use": "^17.5.1",
4143
"tailwind-merge": "2.5.4",
4244
"tailwindcss-animate": "1.0.7",

tsconfig.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"skipLibCheck": true,
610
"strict": true,
@@ -18,7 +22,9 @@
1822
}
1923
],
2024
"paths": {
21-
"@/*": ["./*"]
25+
"@/*": [
26+
"./*"
27+
]
2228
},
2329
"target": "ES2017"
2430
},
@@ -27,7 +33,9 @@
2733
"**/*.ts",
2834
"**/*.tsx",
2935
".next/types/**/*.ts",
30-
"app/code-of-conduct/page.mdx"
36+
"app/code-of-conduct/page.tsx"
3137
],
32-
"exclude": ["node_modules"]
33-
}
38+
"exclude": [
39+
"node_modules"
40+
]
41+
}

0 commit comments

Comments
 (0)