Skip to content

Commit c9f6be6

Browse files
Display special text on unfinished pages
1 parent f454b91 commit c9f6be6

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
import { marked } from 'marked';
3+
4+
interface Props {
5+
description: string;
6+
}
7+
8+
const { description } = Astro.props;
9+
10+
const path = Astro.url.pathname;
11+
---
12+
{description.includes("NEEDS DOCUMENTATION") ? (
13+
<p style="color: var(--sl-color-orange); font-size: 2rem;"><strong>This page is incomplete! Help wanted!</strong>
14+
<br>Please finish this page using the <a target="_blank" href={"https://wiki.multitheftauto.com/wiki" + path}>corresponding Old Wiki article</a>.
15+
<br>Go to <a target="_blank" href="https://github.com/multitheftauto/wiki.multitheftauto.com/blob/main/CONTRIBUTING.md">Contribution guidelines</a> for more information.</p>
16+
) : (
17+
<Fragment set:html={marked(description)} />
18+
)}

web/src/pages/[event].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { NotesType } from '@src/utils/types';
1212
1313
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1414
import CodeExamplesSection from '@src/components/CodeExamplesSection.astro';
15+
import ItemDescription from '@src/components/ItemDescription.astro';
1516
1617
export async function getStaticPaths() {
1718
const events = await getCollection('events');
@@ -70,7 +71,7 @@ if (Array.isArray(event.data.notes) && event.data.notes.length > 0) {
7071
tableOfContents: false,
7172
}}>
7273
<!-- Description -->
73-
<Fragment set:html={marked(event.data.description)} />
74+
<ItemDescription description={event.data.description} />
7475

7576
<!-- Notes -->
7677
{notesContent.length > 0 && (

web/src/pages/[func].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1515
import CodeExamplesSection from '@src/components/CodeExamplesSection.astro';
1616
1717
import ChangelogList from '@src/components/ChangelogList.astro';
18+
import ItemDescription from '@src/components/ItemDescription.astro';
1819
1920
export async function getStaticPaths() {
2021
const functions = await getCollection('functions');
@@ -88,7 +89,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
8889
)}
8990

9091
<!-- Description -->
91-
{funcInfo.description && <Fragment set:html={marked(funcInfo.description)} />}
92+
<ItemDescription description={funcInfo.description} />
9293

9394
<!-- Notes -->
9495
{notesContent.length > 0 && (

0 commit comments

Comments
 (0)