Change md path

This commit is contained in:
MartinBraquet
2025-09-10 16:14:33 +02:00
parent 9d1423c41b
commit 09858d0783
9 changed files with 108 additions and 21 deletions

View File

@@ -0,0 +1,21 @@
import {LovePage} from "web/components/love-page";
import {Col} from "web/components/layout/col";
import ReactMarkdown from "react-markdown";
import React from "react";
type Props = {
content: string;
filename: string;
};
export default function MarkdownPage({ content, filename }: Props) {
return (
<LovePage trackPageView={filename} className={'col-span-8'}>
<Col className="items-center">
<Col className='bg-canvas-0 w-full rounded px-3 py-4 sm:px-6 space-y-4 customlink'>
<ReactMarkdown>{content}</ReactMarkdown>
</Col>
</Col>
</LovePage>
);
}

View File

@@ -0,0 +1,19 @@
import React from 'react';
import fs from 'fs';
import path from 'path';
import MarkdownPage from "web/components/markdown";
const FILENAME = 'constitution';
export async function getStaticProps() {
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
const content = fs.readFileSync(filePath, 'utf8');
return {props: {content}};
}
type Props = { content: string };
export default function Faq({content}: Props) {
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
}

19
web/pages/faq.tsx Normal file
View File

@@ -0,0 +1,19 @@
import React from 'react';
import fs from 'fs';
import path from 'path';
import MarkdownPage from "web/components/markdown";
const FILENAME = 'faq';
export async function getStaticProps() {
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
const content = fs.readFileSync(filePath, 'utf8');
return {props: {content}};
}
type Props = { content: string };
export default function Faq({content}: Props) {
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
}

19
web/pages/financials.tsx Normal file
View File

@@ -0,0 +1,19 @@
import React from 'react';
import fs from 'fs';
import path from 'path';
import MarkdownPage from "web/components/markdown";
const FILENAME = 'financials';
export async function getStaticProps() {
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
const content = fs.readFileSync(filePath, 'utf8');
return {props: {content}};
}
type Props = { content: string };
export default function Faq({content}: Props) {
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
}

View File

@@ -1,39 +1,29 @@
import React from 'react';
import ReactMarkdown from 'react-markdown';
import fs from 'fs';
import path from 'path';
import {LovePage} from "web/components/love-page";
import {Col} from "web/components/layout/col";
import MarkdownPage from "web/components/markdown";
type Props = {
content: string;
filename: string;
};
export default function MarkdownPage({ content, filename }: Props) {
return (
<LovePage trackPageView={filename}>
<Col className="items-center">
<Col className='bg-canvas-0 w-full rounded px-3 py-4 sm:px-6 space-y-4 customlink'>
<ReactMarkdown>{content}</ReactMarkdown>
</Col>
</Col>
</LovePage>
);
export default function Markdown({content, filename}: Props) {
return <MarkdownPage content={content} filename={filename}></MarkdownPage>
}
export async function getStaticPaths() {
const mdDir = path.join(process.cwd(), 'public', 'md');
const files = fs.readdirSync(mdDir);
const paths = files.map((file) => ({
params: { filename: file.replace(/\.md$/, '') },
params: {filename: file.replace(/\.md$/, '')},
}));
return { paths, fallback: false };
return {paths, fallback: false};
}
export async function getStaticProps({ params }: { params: { filename: string } }) {
export async function getStaticProps({params}: { params: { filename: string } }) {
const filePath = path.join(process.cwd(), 'public', 'md', `${params.filename}.md`);
const content = fs.readFileSync(filePath, 'utf8');
return { props: { content, filename: params.filename } };
return {props: {content, filename: params.filename}};
}

19
web/pages/members.tsx Normal file
View File

@@ -0,0 +1,19 @@
import React from 'react';
import fs from 'fs';
import path from 'path';
import MarkdownPage from "web/components/markdown";
const FILENAME = 'members';
export async function getStaticProps() {
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
const content = fs.readFileSync(filePath, 'utf8');
return {props: {content}};
}
type Props = { content: string };
export default function Faq({content}: Props) {
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
}

View File

@@ -27,7 +27,7 @@ We, the community of Compass, commit to building and maintaining this project in
- Sustained inactivity (e.g., less than 10 hours of contribution for 12 months).
- Proven bad-faith conduct (vote manipulation, harassment, sabotage). Removal requires a **2/3 vote** of Members.
[Current members and administrators](/md/members)
[Current members and administrators](/members)
## Article III: Governance Structure

View File

@@ -33,7 +33,7 @@ Martin continues to serve as an initiator and steward of Compass, but its direct
### How does governance work?
Compass is run democratically under a [constitution](/md/constitution) that prevents central control and ensures long-term alignment with its mission.
Compass is run democratically under a [constitution](/constitution) that prevents central control and ensures long-term alignment with its mission.
* Major decisions (scope, funding, rules) are voted on by **active contributors**.
* The full constitution is **public and transparent**.
@@ -57,7 +57,7 @@ Through **donations from the community**. Options include:
* PayPal
* GitHub Sponsors
All funding and expenses are **publicly documented** [here](/md/financials).
All funding and expenses are **publicly documented** [here](/financials).
### Is my data safe?

View File

@@ -1,6 +1,6 @@
# Current Members and Administrators
See the [full constitution](/md/constitution) for details on membership criteria and governance structure.
See the [full constitution](/constitution) for details on membership criteria and governance structure.
### Members