Skip to content

Commit 2bde8c0

Browse files
WIki index page revamp
1 parent 4a9fc82 commit 2bde8c0

File tree

9 files changed

+279
-31
lines changed

9 files changed

+279
-31
lines changed

assets/index/mta_logo.png

17.3 KB
Loading

web/astro.config.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { SITE_TITLE, SITE_URL } from './src/content.constants';
66

77
export default defineConfig({
88
site: SITE_URL,
9+
redirects: {
10+
// External redirects only, the others are handled by CloudFlare pages (_redirects file)
11+
"/How_you_can_help": "https://github.com/multitheftauto/wiki.multitheftauto.com/blob/main/CONTRIBUTING.md",
12+
},
913
i18n: {
1014
locales: ["en", "es", "fr"],
1115
defaultLocale: "en",
@@ -76,9 +80,9 @@ export default defineConfig({
7680
]
7781
},
7882
{
79-
label: 'Element types',
83+
label: 'Elements',
8084
items: [
81-
{label: 'Element', link: 'Element'},
85+
{label: 'Element types', link: 'Element'},
8286
{label: 'Element tree', link: 'Element_tree'},
8387
{label: 'Entity', link: 'Entity'},
8488
]

web/src/content.constants.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
export const SITE_TITLE = 'Multi Theft Auto: Wiki';
22
export const SITE_URL = 'https://wiki.preview.multitheftauto.com';
33
export const OLD_WIKI_URL = 'https://wiki.multitheftauto.com';
4-
export const OLD_WIKI_REDIRECT = true; // Set to false to disable redirecting to old wiki on 404
4+
export const OLD_WIKI_REDIRECT = true; // Set to false to disable redirecting to old wiki on 404
5+
export const MTA_CURRENT_VERSION = {
6+
full: '1.6.0',
7+
short: '1.6',
8+
};

web/src/pages/Lua_API.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
11
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
2+
import AnchorHeading from '@astrojs/starlight/components/AnchorHeading.astro';
3+
import { getSeeAlsoLinksFromList } from '@src/utils/general';
4+
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
25

36
<StarlightPage frontmatter={{
47
template: 'doc',
58
title: 'Lua API',
69
tableOfContents: false,
10+
hero: {
11+
tagline: "Power up your gameplay with the MTA Lua API – script smarter, play harder.",
12+
actions: [
13+
{
14+
text: 'Functions',
15+
link: '/Scripting_Functions',
16+
variant: 'secondary',
17+
icon: 'magnifier',
18+
},
19+
{
20+
text: 'Events',
21+
link: '/Scripting_Events',
22+
variant: 'secondary',
23+
icon: 'magnifier',
24+
},
25+
{
26+
text: 'Elements',
27+
link: '/Element',
28+
variant: 'secondary',
29+
icon: 'magnifier',
30+
},
31+
{
32+
text: 'OOP',
33+
link: '/OOP_Introduction',
34+
variant: 'secondary',
35+
icon: 'magnifier',
36+
},
37+
]
38+
},
739
}}>
40+
### About
841
The MTA **Lua API** is built on an extended version of [Lua 5.1](https://www.lua.org/manual/5.1/) and offers tools to enhance and customize gameplay.
42+
43+
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
44+
'article:OOP_Introduction',
45+
])} currentId='' />
46+
947
</StarlightPage>

web/src/pages/es/index.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/src/pages/fr/index.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/src/pages/index.astro

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
---
2+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
import { Image } from 'astro:assets';
4+
5+
// IMAGES
6+
import image_mtaLogo from '../../../assets/index/mta_logo.png';
7+
8+
import { MTA_CURRENT_VERSION } from '@src/content.constants';
9+
import { Icon } from '@astrojs/starlight/components';
10+
---
11+
12+
<StarlightPage frontmatter={{
13+
template: 'doc',
14+
tableOfContents: false,
15+
title: 'Multi Theft Auto: Wiki',
16+
head: [
17+
{
18+
tag: 'title',
19+
content: 'Multi Theft Auto: Wiki',
20+
}
21+
],
22+
}}>
23+
<div class="mtahero">
24+
<div class="mtahero_left">
25+
<Image src={image_mtaLogo} alt="Multi Theft Auto Logo"/>
26+
</div>
27+
28+
<div class="mtahero_right">
29+
<p>Welcome to the <strong>new Multi Theft Auto Wiki</strong> (work in progress). Visit this wiki's <a href="https://github.com/multitheftauto/wiki.multitheftauto.com" target="_blank">GitHub repository</a> for more information about the project and how to contribute. The old wiki is still active at <a href="https://wiki.multitheftauto.com/wiki/Main_Page">wiki.multitheftauto.com</a> (where unofficial articles and pages are still available).</p>
30+
31+
<p>There are many <a href="/How_you_can_help" target="_blank">things you can do</a> to help us improve MTA - create a map, a gamemode, help document scripting functions, write example code, write tutorials or just play MTA and report the bugs you find.</p>
32+
33+
<p>If you have any questions or problems related to scripting, feel free to get in touch with us on <a href="https://discord.com/invite/mtasa" target="_blank">Discord</a>.</p>
34+
35+
<p class="bigtext"><em>[ Stop playing with yourself ]</em></p>
36+
</div>
37+
</div>
38+
39+
<div class="mtagrid">
40+
<div class="mtabox">
41+
<h3>Play</h3>
42+
<div>
43+
<a class="downloadmta" href="https://multitheftauto.com/"><Icon size="1.8rem" name="download" color="lightgreen" class="inline-icon" />Download <strong>Multi Theft Auto: San Andreas</strong> ({MTA_CURRENT_VERSION.full})</a>
44+
</div>
45+
<ul>
46+
<li><a href="/Where_to_buy_GTASA">Where to buy GTASA</a></li>
47+
<li><a href="/Client_Manual">Client Manual</a></li>
48+
<li><a href="/Changes_in_current_version">Changes in Current Version</a></li>
49+
<li><a href="/Known_Issues_-_FAQ">Known Issues</a></li>
50+
<li><a href="/Server_Manual">Server Manual</a></li>
51+
<li><a href="/Map_manager">Map Manager</a></li>
52+
</ul>
53+
</div>
54+
<div class="mtabox">
55+
<h3>Map Editor</h3>
56+
<ul>
57+
<li><a href="/Resource:Editor">Manual</a></li>
58+
<li><a href="/Resource:Editor/EDF">Editor Definition Format</a></li>
59+
<li><a href="/Resource:Editor/Plugins">Plugins</a></li>
60+
<li><a href="/Resource:Editor#FAQ">Frequently Asked Questions</a></li>
61+
</ul>
62+
</div>
63+
64+
<div class="mtabox">
65+
<h3>Databases</h3>
66+
<p>This section outlines all the Lua capabilities MTA or resources provide.</p>
67+
<ul>
68+
<li><a href="/Category:Resource">Resource Catalogue</a></li>
69+
<li><a href="/Client_side_scripts">Client side scripts</a></li>
70+
<li><a href="/Modules">Modules</a></li>
71+
</ul>
72+
</div>
73+
74+
<div class="mtabox">
75+
<h3>Developing Multi Theft Auto</h3>
76+
<a href="https://nightly.mtasa.com/">
77+
Nightly builds
78+
</a>
79+
<ul>
80+
<li><a href="/Compiling_MTASA">Compiling MTASA on Windows</a></li>
81+
<li><a href="/Building_MTASA_Server_on_GNU_Linux">Compiling MTASA on GNU/Linux</a></li>
82+
<li><a href="/Coding_guidelines">Coding guidelines</a></li>
83+
<li><a href="https://github.com/multitheftauto/mtasa-blue">Main GitHub repository</a></li>
84+
<li><a href="/Roadmap">Roadmap</a></li>
85+
<li><a href="https://github.com/multitheftauto/mtasa-blue/issues">Bugtracker</a></li>
86+
<li><a href="/Branches">Branches</a></li>
87+
<li><a href="/Forks">Forks and anti cheat</a></li>
88+
</ul>
89+
</div>
90+
91+
<div class="mtabox">
92+
<h3>Wiki - How can you help</h3>
93+
<ul>
94+
<li>Finish documentation for <a href="/Category:Incomplete">Incomplete functions</a></li>
95+
<li><a href="/Category:Needs_Example">Add examples to functions and events</a></li>
96+
<li><a href="/Category:Needs_Checking">Review pages that need checking</a></li>
97+
<li>Write tutorials to help new people</li>
98+
<li>Translate wiki pages</li>
99+
</ul>
100+
</div>
101+
102+
<div class="mtabox">
103+
<h3>Community</h3>
104+
<ul>
105+
<li><a href="https://forum.multitheftauto.com/">Forum</a></li>
106+
<li><a href="https://discord.com/invite/mtasa">Official MTA Discord server</a> (<a href="https://forum.multitheftauto.com/topic/95008-multi-theft-autos-official-discord-server/">Forum post</a>)</li>
107+
<li><a href="https://discord.com/invite/GNN6PRtTnu">Development Discord</a></li>
108+
<li><a href="https://community.multitheftauto.com/">MTA Community</a></li>
109+
<li><a href="https://twitter.com/MTAQA">Twitter</a>, <a href="https://www.youtube.com/user/MTAQA">YouTube</a>, <a href="https://www.facebook.com/multitheftauto">Facebook</a>, <a href="https://www.moddb.com/mods/multi-theft-auto-san-andreas">ModDB</a></li>
110+
</ul>
111+
</div>
112+
113+
114+
<div class="mtabox">
115+
<h3>Scripting</h3>
116+
<ul>
117+
<li><a href="/Scripting_Introduction">Introduction to Scripting</a></li>
118+
<li><a href="/Introduction_to_Scripting_the_GUI">Introduction to Scripting the GUI</a></li>
119+
<li><a href="/Debugging">Debugging Tutorial</a></li>
120+
<li><a href="/Resources">Introduction to Resources</a>
121+
<ul>
122+
<li><a href="/Resource_Web_Access">Resource Web Access</a></li>
123+
<li><a href="/CEF_Tutorial">CEF Tutorial</a></li>
124+
<li><a href="/Category:Resource">Resource Catalogue</a></li>
125+
<li><a href="/Meta.xml">Meta.xml</a></li>
126+
<li><a href="/ACL">ACL</a></li>
127+
</ul>
128+
</li>
129+
<li><a href="/Writing_Gamemodes">Writing Gamemodes</a></li>
130+
<li><a href="/Script_security">Script security</a></li>
131+
</ul>
132+
<p>Forum Links</p>
133+
<ul>
134+
<li><a href="https://forum.multitheftauto.com/forum/71-scripting/">Scripting Sub-Forum</a></li>
135+
<li><a href="https://forum.multitheftauto.com/forum/123-tutorials/">Scripting Tutorials Sub-Forum</a></li>
136+
<li><a href="https://forum.multitheftauto.com/topic/24702-mtasa-wiki-offline-copies-online-mirrors/">Offline Wiki Copies</a></li>
137+
</ul>
138+
<h3>General Lua Help</h3>
139+
<ul>
140+
<li><a href="http://www.lua.org/pil/index.html">Programming in Lua Manual</a></li>
141+
<li><a href="http://www.lua.org/manual/5.1/#index">Internal Lua functions reference</a></li>
142+
<li><a href="http://lua-users.org/wiki/TutorialDirectory">Lua Wiki</a></li>
143+
<li><a href="http://nixstaller.sourceforge.net/manual/0.5.1/nixstaller_10.html">Lua Guide from Nixstaller</a></li>
144+
</ul>
145+
</div>
146+
147+
<div class="mtabox">
148+
<h3>Reference</h3>
149+
<a href="/Lua_API">MTA Lua API Reference</a>
150+
<ul>
151+
<li><a href="/Client_Scripting_Functions">Client-side Functions</a></li>
152+
<li><a href="/Client_Scripting_Events">Client-side Events</a></li>
153+
<li><a href="/Server_Scripting_Functions">Server-side Functions</a></li>
154+
<li><a href="/Server_Scripting_Events">Server-side Events</a></li>
155+
<li><a href="/Useful_Functions">Useful Functions</a></li>
156+
<li><a href="/MTA_Classes">MTA Classes</a></li>
157+
<li><a href="/Element">MTA Elements</a> / <a href="/Element_tree">Element tree</a></li>
158+
</ul>
159+
</div>
160+
161+
<div class="mtabox">
162+
<h3><a href="/Id">ID Lists</a></h3>
163+
<ul>
164+
<li><a href="/Animations">Animations</a></li>
165+
<li><a href="/Character_Skins">Character Skins</a></li>
166+
<li><a href="/CJ_Clothes">Clothing styles</a></li>
167+
<li><a href="/Garage">Garage IDs</a></li>
168+
<li><a href="/Interior_IDs">Interior IDs</a></li>
169+
<li><a href="/Material_IDs">Material IDs</a></li>
170+
<li><a href="/Ped_voices">Ped Voices</a></li>
171+
<li><a href="/Projectiles">Projectiles</a></li>
172+
<li><a href="/Radar_Blips">Radar Blips</a></li>
173+
<li><a href="/Sounds">Sounds</a></li>
174+
<li><a href="/Vehicle_IDs">Vehicle IDs</a></li>
175+
<li><a href="/Vehicle_Colors">Vehicle Colors</a></li>
176+
<li><a href="/Vehicle_Upgrades">Vehicle Upgrades</a></li>
177+
<li><a href="/Vehicle_variants">Vehicle Variants</a></li>
178+
<li><a href="/Vehicle_component_manipulation">Vehicle component manipulation</a></li>
179+
<li><a href="/Weapons">Weapons</a></li>
180+
<li><a href="/Weather">Weather</a></li>
181+
</ul>
182+
</div>
183+
</div>
184+
185+
</StarlightPage>
186+
187+
<style>
188+
.bigtext {
189+
font-size: 1.4em;
190+
font-weight: bold;
191+
}
192+
193+
.mtahero {
194+
display: flex;
195+
align-items: center;
196+
justify-content: space-between;
197+
}
198+
.mtahero_left {
199+
flex: 1;
200+
align-self: flex-start;
201+
padding-right: 16px;
202+
}
203+
.mtahero_right {
204+
flex: 3;
205+
}
206+
207+
.mtagrid {
208+
display: grid;
209+
grid-template-columns: repeat(2, 1fr); /* 2 boxes per row */
210+
gap: 2rem; /* spacing between boxes */
211+
}
212+
213+
.mtabox {
214+
padding: 4px 8px 8px 8px;
215+
padding: 1rem;
216+
}
217+
218+
.downloadmta {
219+
font-size: 1.2em;
220+
color: lightgreen !important;
221+
}
222+
.inline-icon {
223+
display: inline-block;
224+
vertical-align: top;
225+
margin-right: 6px;
226+
}
227+
</style>

web/src/pages/index.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/src/styles/custom.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
}
2525

2626
.see-also-section {
27-
margin-top: 2rem;
27+
margin-top: 4rem;
28+
border-top: 1px solid rgba(255, 255, 255, 0.1);
29+
padding-top: 1.5rem;
2830
}
2931

3032
.code-example {

0 commit comments

Comments
 (0)